Fixed
Status Update
Comments
il...@google.com <il...@google.com>
ap...@google.com <ap...@google.com> #2
Project: platform/frameworks/support
Branch: androidx-master-dev
commit 2f5e3a66a029bfe54f188242c10d6d943f675c6e
Author: jbwoods <jbwoods@google.com>
Date: Thu May 30 18:41:05 2019
Check that Fragments are still hidden before animating
If a fragment is hidden with an animation and set to be shown again
before the animation completes, the animation will be executed later,
causeing the fragment to disappear. We do not have a reference to the
animator after it sets the AnimatorListenerAdapter and as a result, we
cannot cancel the animation.
This change checks that the Fragment should still be hidden before
setting its visibility to View.GONE.
Test: Added Test, tested in app, all test pass
BUG: 133385058
Change-Id: I400b71dcb3f1c64e0cf9e5a2a9d9a82a2b10dfd6
M fragment/src/androidTest/java/androidx/fragment/app/FragmentAnimatorTest.kt
M fragment/src/main/java/androidx/fragment/app/FragmentManagerImpl.java
https://android-review.googlesource.com/974083
https://goto.google.com/android-sha1/2f5e3a66a029bfe54f188242c10d6d943f675c6e
Branch: androidx-master-dev
commit 2f5e3a66a029bfe54f188242c10d6d943f675c6e
Author: jbwoods <jbwoods@google.com>
Date: Thu May 30 18:41:05 2019
Check that Fragments are still hidden before animating
If a fragment is hidden with an animation and set to be shown again
before the animation completes, the animation will be executed later,
causeing the fragment to disappear. We do not have a reference to the
animator after it sets the AnimatorListenerAdapter and as a result, we
cannot cancel the animation.
This change checks that the Fragment should still be hidden before
setting its visibility to View.GONE.
Test: Added Test, tested in app, all test pass
BUG: 133385058
Change-Id: I400b71dcb3f1c64e0cf9e5a2a9d9a82a2b10dfd6
M fragment/src/androidTest/java/androidx/fragment/app/FragmentAnimatorTest.kt
M fragment/src/main/java/androidx/fragment/app/FragmentManagerImpl.java
jb...@google.com <jb...@google.com> #3
This has been fixed internally and will be available in the Fragment 1.1.0-beta02 release.
Description
Version used: 1.0.0-beta01
Devices/Android versions reproduced on: AVD, API 28.
Start a new FragmentTransaction which shows previous hidden fragment in the middle of previous transitions animation will cause the showing fragment disappear.
It seems that this is because Animator's Listener is not cleared when a new transaction is created.
the sample project attached shows this issue by commit a showA,hideB transaction at first, and then commit a showB,hideA transaction after 400ms, both transaction have their customAnimation set, the custom transition animation's duration is 1000ms.