Obsolete
Status Update
Comments
re...@google.com <re...@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!
re...@google.com <re...@google.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
da...@chromium.org <da...@chromium.org> #5
deleted
re...@google.com <re...@google.com> #6
Did some digging and found a bug for this on the YouTube side:
Description
Affected Chrome Version(s): 134.0.6998.178
Affected Operating Systems: Windows NT: 10.0.26100, Windows NT: 10.0.19045, Windows NT: 10.0.22631
Issue Description + Insights/Patterns:
Timeline: First report on March 28, 2025 12:35 PM (MDT)
Highlighted User Voice Examples (Access:http://shortn/_0E2VFlfXQ2 ):
Listnr queries for reference: