Fixed
Status Update
Comments
yb...@google.com <yb...@google.com> #2
This has been fixed internally and will be available in the next release of Fragments.
yb...@google.com <yb...@google.com> #3
Sorry, that message is not correct yet.
ap...@google.com <ap...@google.com> #4
Project: platform/frameworks/support
Branch: androidx-master-dev
commit 47c5e9d30d0304a7d1ac6a522c01a055b858ff28
Author: Jeremy Woods <jbwoods@google.com>
Date: Mon Aug 24 14:47:02 2020
Use view alpha to store the view animation state
Currently when using the new state manager, we save the visibility of
the view from onViewCreated() to do proper effects. This visibility
is restored after onStart() when any special effects are complete.
Because we always restore the visibility to whatever it was in
onViewCreated(), we fail to capture any changes that could have been
made by the user between onViewCreated() and onStart(). This means if
view animating in is set to INVISIBLE in onStart(), we force it back to
VISIBILE once the animation is complete.
Since there are still cases where users set their visibility directly on
their views, we need to ensure we are backward compatible. To do so,
instead of storing the view visibility, we should use the view alpha.
Anything above an alpha of 0 is considered visibile. Doing this means we
can handle the case where the visibility is changed, but the
suggestively more rare case of the alpha changing will suffer from the
old issue.
Test: FragmentViewTest, PostponedTransitionTest
Bug: 164481490
Change-Id: I9df6398af8e0404638e83b69319e4bd32bdbc3f2
M fragment/fragment/src/androidTest/java/androidx/fragment/app/FragmentAnimationTest.kt
M fragment/fragment/src/androidTest/java/androidx/fragment/app/FragmentAnimatorTest.kt
M fragment/fragment/src/androidTest/java/androidx/fragment/app/FragmentViewTest.kt
M fragment/fragment/src/androidTest/java/androidx/fragment/app/PostponedTransitionTest.kt
M fragment/fragment/src/main/java/androidx/fragment/app/Fragment.java
M fragment/fragment/src/main/java/androidx/fragment/app/FragmentStateManager.java
M fragment/fragment/src/main/java/androidx/fragment/app/SpecialEffectsController.java
https://android-review.googlesource.com/1404407
Branch: androidx-master-dev
commit 47c5e9d30d0304a7d1ac6a522c01a055b858ff28
Author: Jeremy Woods <jbwoods@google.com>
Date: Mon Aug 24 14:47:02 2020
Use view alpha to store the view animation state
Currently when using the new state manager, we save the visibility of
the view from onViewCreated() to do proper effects. This visibility
is restored after onStart() when any special effects are complete.
Because we always restore the visibility to whatever it was in
onViewCreated(), we fail to capture any changes that could have been
made by the user between onViewCreated() and onStart(). This means if
view animating in is set to INVISIBLE in onStart(), we force it back to
VISIBILE once the animation is complete.
Since there are still cases where users set their visibility directly on
their views, we need to ensure we are backward compatible. To do so,
instead of storing the view visibility, we should use the view alpha.
Anything above an alpha of 0 is considered visibile. Doing this means we
can handle the case where the visibility is changed, but the
suggestively more rare case of the alpha changing will suffer from the
old issue.
Test: FragmentViewTest, PostponedTransitionTest
Bug: 164481490
Change-Id: I9df6398af8e0404638e83b69319e4bd32bdbc3f2
M fragment/fragment/src/androidTest/java/androidx/fragment/app/FragmentAnimationTest.kt
M fragment/fragment/src/androidTest/java/androidx/fragment/app/FragmentAnimatorTest.kt
M fragment/fragment/src/androidTest/java/androidx/fragment/app/FragmentViewTest.kt
M fragment/fragment/src/androidTest/java/androidx/fragment/app/PostponedTransitionTest.kt
M fragment/fragment/src/main/java/androidx/fragment/app/Fragment.java
M fragment/fragment/src/main/java/androidx/fragment/app/FragmentStateManager.java
M fragment/fragment/src/main/java/androidx/fragment/app/SpecialEffectsController.java
Description
Component used:
lifecycle-runtime-ktx
Version used:
2.2.0-alpha01 up to 2.3.0-alpha07
The following example should print "1", "2" then "3" but prints "1", "3", "2":
A similar problem existed inhttps://github.com/Kotlin/kotlinx.coroutines/issues/1474
Dispatchers.Main
but was fixed: