Assigned
Status Update
Comments
ra...@google.com <ra...@google.com> #2
Hi, thanks for reporting.
As a temporary workaround, you can probably:
- unregister your margin transformer
- register a MarginPageTransformer with an offset of 0
- viewpager2.requestTransform()
- viewpager2.adapter.notifyItemInserted()
- revert back to the original transformer
It should be indistinguishible from the user perspective when done while viewPager.getScrollState() == SCROLL_STATE_IDLE (at that stage, there is no visible offset).
If it's not there, OnPageChangeCallback will notify you once the viewpager changes to SCROLL_STATE_IDLE.
Alternatively, if you don't want the animation, a notifyDatasetChanged() should work fine. Especially if you're using Fragments, as they will be kept around.
Apologies for the extra steps. We'll look into it!
As a temporary workaround, you can probably:
- unregister your margin transformer
- register a MarginPageTransformer with an offset of 0
- viewpager2.requestTransform()
- viewpager2.adapter.notifyItemInserted()
- revert back to the original transformer
It should be indistinguishible from the user perspective when done while viewPager.getScrollState() == SCROLL_STATE_IDLE (at that stage, there is no visible offset).
If it's not there, OnPageChangeCallback will notify you once the viewpager changes to SCROLL_STATE_IDLE.
Alternatively, if you don't want the animation, a notifyDatasetChanged() should work fine. Especially if you're using Fragments, as they will be kept around.
Apologies for the extra steps. We'll look into it!
je...@gmail.com <je...@gmail.com> #3
Project: platform/frameworks/support
Branch: androidx-master-dev
commit f3df487541c41b9b0e81199a73eaeda058cab7a9
Author: Jakub Gielzak <jgielzak@google.com>
Date: Thu Aug 01 22:20:00 2019
Fix for PageTransformer + dataSet animations clash
Suspends data-set change animations in the presence of a
PageTransformer.
Bug: 134658996
Test: ./gradlew viewpager2:connectedCheck
Change-Id: I873f7233a87b553ef6f410a76b35e6567bd4dc80
A viewpager2/src/androidTest/java/androidx/viewpager2/widget/PageTransformerItemAnimatorTest.kt
M viewpager2/src/main/java/androidx/viewpager2/widget/ViewPager2.java
https://android-review.googlesource.com/1095609
https://goto.google.com/android-sha1/f3df487541c41b9b0e81199a73eaeda058cab7a9
Branch: androidx-master-dev
commit f3df487541c41b9b0e81199a73eaeda058cab7a9
Author: Jakub Gielzak <jgielzak@google.com>
Date: Thu Aug 01 22:20:00 2019
Fix for PageTransformer + dataSet animations clash
Suspends data-set change animations in the presence of a
PageTransformer.
Bug: 134658996
Test: ./gradlew viewpager2:connectedCheck
Change-Id: I873f7233a87b553ef6f410a76b35e6567bd4dc80
A viewpager2/src/androidTest/java/androidx/viewpager2/widget/PageTransformerItemAnimatorTest.kt
M viewpager2/src/main/java/androidx/viewpager2/widget/ViewPager2.java
Description
========================================================================
#REMINDER: Please do not disclose any PII. Some examples of PII are email address, IP, contact number, any part of name, project numbers and billing accounts. Comments or attachments that include PII will be removed and restricted from public viewing as it may violate our security and privacy policies.
Please refrain from emailing a reply to a comment as this will make your email address visible. Instead, you may use the Issue Tracker’s comment feature for your replies.
It is OK to share your API Project ID, but _not_ API keys or client ID credentials.
To learn more about personal data, visit
========================================================================
Issue report
----------------
What steps will reproduce the problem? Please provide a link to a
demonstration page if at all possible, or attach code.
1.Run this URL:
2. The correct address is Danmarksgade 59, 9900 Frederikshavn.
3. The API returns Danmarksgade 59, 5000 Frederikshavn