Fixed
Status Update
Comments
mi...@sherpany.com <mi...@sherpany.com> #2
I've done few improvements to sample:
- added log (check "BUG" Tag) which logs currently used animation
- add different animation for each enter,popenter,exit,popexit to see what really is going on
- added buttons to be able to go back and forth in app
correct path -> open app, wait for enter animation, press back button -> press button on main fragment -> and loop it :)
faulty path -> open app, wait for enter animation, press back button on middle -> observe wrong animation -> press button on middle and go back to child fragment.
- added log (check "BUG" Tag) which logs currently used animation
- add different animation for each enter,popenter,exit,popexit to see what really is going on
- added buttons to be able to go back and forth in app
correct path -> open app, wait for enter animation, press back button -> press button on main fragment -> and loop it :)
faulty path -> open app, wait for enter animation, press back button on middle -> observe wrong animation -> press button on middle and go back to child fragment.
fi...@gmail.com <fi...@gmail.com> #3
hey, you are advising to use single activity but you even don't care to replay to bug connected with Fragments ;/ With that bug I can't do nice / animated app with nested fragments - please at least say that you won't fix it and I will switch back to multi-activity approach
il...@google.com <il...@google.com> #4
Sorry for the delay. Yes, this does appear to be an issue (the sample project definitely helped a lot!) where the child Fragment is being removed due to the entire Fragment being destroyed.
Since the animations (and specifically getNextAnim()) is only updated when the child FragmentManager's back stack is changed, getNextAnim() isn't set properly when a FragmentTransaction happens on the parent FragmentManager (which it knows nothing about). We'll look into how to fix that issue.
Since the animations (and specifically getNextAnim()) is only updated when the child FragmentManager's back stack is changed, getNextAnim() isn't set properly when a FragmentTransaction happens on the parent FragmentManager (which it knows nothing about). We'll look into how to fix that issue.
il...@google.com <il...@google.com>
ap...@google.com <ap...@google.com> #5
Project: platform/frameworks/support
Branch: androidx-master-dev
commit b63edf639463ad59101be8883bf4b3de0824440b
Author: jbwoods <jbwoods@google.com>
Date: Fri May 24 09:36:48 2019
Clear animations after they are loaded.
We should clear animations after they have been used to ensure we do not
accidentally use an old animation.
Test: all tests pass, added check to ensure the are cleared.
BUG: 121017790
Change-Id: Ia14998c90aae5e82fab93084ce024b6b3874059d
M fragment/src/androidTest/java/androidx/fragment/app/FragmentAnimationTest.kt
M fragment/src/main/java/androidx/fragment/app/FragmentManagerImpl.java
https://android-review.googlesource.com/970766
https://goto.google.com/android-sha1/b63edf639463ad59101be8883bf4b3de0824440b
Branch: androidx-master-dev
commit b63edf639463ad59101be8883bf4b3de0824440b
Author: jbwoods <jbwoods@google.com>
Date: Fri May 24 09:36:48 2019
Clear animations after they are loaded.
We should clear animations after they have been used to ensure we do not
accidentally use an old animation.
Test: all tests pass, added check to ensure the are cleared.
BUG: 121017790
Change-Id: Ia14998c90aae5e82fab93084ce024b6b3874059d
M fragment/src/androidTest/java/androidx/fragment/app/FragmentAnimationTest.kt
M fragment/src/main/java/androidx/fragment/app/FragmentManagerImpl.java
ap...@google.com <ap...@google.com> #6
Project: platform/frameworks/support
Branch: androidx-master-dev
commit 0491995874ce17bcaf19ad9864f5ec6a0ae1b46d
Author: jbwoods <jbwoods@google.com>
Date: Thu Apr 25 17:27:59 2019
Avoid child Fragment animations running during parent Fragment transactions
When a child fragment is on top of the parent and that parent is replaced,
the child fragment's animation from the most previous operation is
executed. This can cause unexpected behavior in developer animations.
Just clearing the child animation results in the parent fragment
appearing on top of the child as the animation is executed. This is
because the child fragment's view is removed before the parent animation
is executed.
This change ensures that if a parent fragment is being removed, its
child fragment's view remains, and is destroyed with its parent's view.
Test: added test, tested visually in app
BUG: 121017790
Change-Id: I4f008316ea00258f9bec445216f1b612330d509a
M fragment/src/androidTest/java/androidx/fragment/app/FragmentAnimationTest.kt
M fragment/src/main/java/androidx/fragment/app/FragmentManagerImpl.java
https://android-review.googlesource.com/951635
https://goto.google.com/android-sha1/0491995874ce17bcaf19ad9864f5ec6a0ae1b46d
Branch: androidx-master-dev
commit 0491995874ce17bcaf19ad9864f5ec6a0ae1b46d
Author: jbwoods <jbwoods@google.com>
Date: Thu Apr 25 17:27:59 2019
Avoid child Fragment animations running during parent Fragment transactions
When a child fragment is on top of the parent and that parent is replaced,
the child fragment's animation from the most previous operation is
executed. This can cause unexpected behavior in developer animations.
Just clearing the child animation results in the parent fragment
appearing on top of the child as the animation is executed. This is
because the child fragment's view is removed before the parent animation
is executed.
This change ensures that if a parent fragment is being removed, its
child fragment's view remains, and is destroyed with its parent's view.
Test: added test, tested visually in app
BUG: 121017790
Change-Id: I4f008316ea00258f9bec445216f1b612330d509a
M fragment/src/androidTest/java/androidx/fragment/app/FragmentAnimationTest.kt
M fragment/src/main/java/androidx/fragment/app/FragmentManagerImpl.java
jb...@google.com <jb...@google.com> #7
This has been fixed internally and will be available in the Fragments 1.1.0-beta01 release.
Description
Version used: 28 (same on 1.0.0)
Devices/Android versions reproduced on: 8.0
If this is a bug in the library, we would appreciate if you could attach:
- Sample project to trigger the issue.
attached sample project:
on app start you can see animation on child fragment enter (slide down)
with pressing "back" you can see correct exit animation (slide up)
with pressing button on center of screen you can observe error -> fragment should disappear but enter animation is played
RCA: (as far as I investigated that)
971 -> here child FragmentManager try to load animation for fragment but fragment.getNextAnim() still return "last" animation which is enter -> it should be updated to exit animation before -> in this place fragment manager know that it's removing fragment