Status Update
Comments
be...@citymapper.com <be...@citymapper.com> #2
Jeremy, is this still an issue? I think the problem was that you had two transitions targeting the same View for the same action (e.g. two Slide() transitions).
il...@google.com <il...@google.com> #3
I have a similar issue with plain AnimatorSet:
set.start()
set.pause()
set.setCurrentPlayTime(100)
set.setCurrentPlayTime(0)
set.setCurrentPlayTime(100)
set.resume()
doesn't play animation in resume().
be...@citymapper.com <be...@citymapper.com> #4
Should clarify that if I filter out setCurrentPlayTime(0)
(or replace it with setCurrentPlayTime(1)
) it works well.
Also even with setCurrentPlayTime(0)
, onAnimationEnd
is notified with correct delay (as if the animation has played).
il...@google.com <il...@google.com> #5
@
I think that is intended for Animator. If you set the currentPlayTime
to 0 or the total duration the animator completes. We do some
mr...@gmail.com <mr...@gmail.com> #6
Did some investigation on the Fragment side and it seems like the merged transition is targeting correctly.
Exiting Transition: Slide@aa9288e: tgts(android.widget.LinearLayout{f9add3d})
>>>>> ExitingViews <<<<<
View: android.widget.LinearLayout{f9add3d}
Entering Transition: Slide@35b8af: tgts(android.widget.LinearLayout{b7f24bc})
>>>>> EnteringViews <<<<<
View: android.widget.LinearLayout{b7f24bc}
Final merged transition: TransitionSet@7bc1c45:
TransitionSet@e133f9a:
Slide@aa9288e: tgts(android.widget.LinearLayout{f9add3d})
Slide@35b8af: tgts(android.widget.LinearLayout{b7f24bc})
merged transition passed to controlDelayedTransition: TransitionSet@7bc1c45:
TransitionSet@e133f9a:
Slide@aa9288e: tgts(android.widget.LinearLayout{f9add3d})
Slide@35b8af: tgts(android.widget.LinearLayout{b7f24bc})
Still digging.
il...@google.com <il...@google.com> #7
Branch: androidx-main
commit 567b7459329d1ec8d27a8c6fe1c4a86442065d7d
Author: Jeremy Woods <jbwoods@google.com>
Date: Tue Sep 26 20:06:54 2023
Add additional logging for transitions
Adding more debug logging in transitions to track the entering and
exiting transitions as well as the final merged transition and its
targets.
Test: added logging
Bug: 300157785
Change-Id: I0d9ad72b865422493c6c895ddb6115abf85eed16
M fragment/fragment/src/main/java/androidx/fragment/app/DefaultSpecialEffectsController.kt
Description
Version used: 1.2.0-rc03
Devices/Android versions reproduced on:
- Pixel 3 API 27 Emulator
- Pixel 3 API 29 Emulator
- LG G7 ThinQ API 28
Sample code:
How to use:
- Make sure Fragment F1 is using layout fragment_f1_bad. Use the code to start the MainActivity, produce a configuration change (eg: rotate the device) --> it will crash due to an Exception is thrown in a check code.
- Changing F1 layout to fragment_f1_good and it will be fine.
Description:
- Saying I have a Fragment F1 in my Activity, defined either by xml (fragment tag or FragmentContainerView) or manual adding at runtime.
- F1's layout is defined in an xml with a 'fragment' tag whose name is a Fragment F2.
- The app starts normally as usual.
- If a configuration change happens, the destruction of F1 will call F2's onViewCreated.
In the sample app, I put a check code which checks if the Activity is destroyed or not, and in this case it will crash the app.
The expected behavior should be: the destruction of F1 should not call F2's onViewCreated.
This issue doesn't occur on 1.2.0-rc03 IF I use `FragmentContainerView` instead of `fragment` to add F2.
This issue cannot be reproduced on 1.2.0-rc02, 1.2.0-rc01 and (I believe) earlier versions.
Please find a call stack in attached screenshot (taken from a debug session on Pixel 3 API 29 Emulator).