Status Update
Comments
ad...@google.com <ad...@google.com>
se...@google.com <se...@google.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).
ja...@jackcheung.com <ja...@jackcheung.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().
se...@google.com <se...@google.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).
se...@google.com <se...@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
se...@google.com <se...@google.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.
ch...@google.com <ch...@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
se...@google.com <se...@google.com> #8
So I have isolated this outside of fragment into something much simpler and I think it breaks down when it comes to the adding and removing of Views with animateToStart.
The attached sample is a simple add that goes between two screens BLUE
and GREEN
. It has code for both the 1.5.0-alpha03
and 1.5.0-alpha04
versions, but I think alpha04 is currently broken in another way so I will upload the alpha03 version here.
This is integrated with predictive back similar to how fragment is, so upon cancelling we call animateToStart
, then we do a beginDelayedTransition
on a 0
duration Fade()
and we reverse the view visibility back to what it was prior to starting the transition.
If you only do visibility, cancel always works the view never goes away, it is wonderful, but when you do adding and removing views like we need to in fragment it fails.
First the code for beginDelayedTransition goes from this:
TransitionManager.beginDelayedTransition(container, Fade().apply {
duration = 0
})
reverseViews()
to this:
TransitionManager.beginDelayedTransition(container, Fade().apply {
duration = 0
addListener(onEnd = {
reverseViews()
blueScreen.visibility = View.VISIBLE
greenScreen.visibility = View.VISIBLE
})
})
reverseViews(useVisibility = true)
We need to make this change because after the animateToStart()
view is still parented by the overlay, so we call reverseViews(useVisibility = true)
to only change the visibility and then once the transition finishes we can call reverseViews()
to parent the view properly, then we make both views visible again.
From our perspective after the 0
duration transition our views are back in the proper state, but they do not transition properly after a cancel.
If the app is doing this wrong and we can make the appropriate fixes, doing the same in fragment should resolve this. There is logging available that shows the state of the views when we start the transition.
se...@google.com <se...@google.com> #9
The API has changed since that project was created in a way that makes the API more robust. I'm hoping that has fixed this...
al...@google.com <al...@google.com> #10
There appears to be a problem with the order of operations. I'm going to look into fixing that.
ch...@google.com <ch...@google.com> #11
Branch: androidx-main
commit e57dd5f9ac6cbb8cf83b221e2d5b3fbd3e88ce6b
Author: George Mount <mount@google.com>
Date: Thu Nov 09 14:33:53 2023
Fix animateToStart with Slide.
Fixes: 300157785
Slide was not repositioning the View to its proper
translation after animating it to the start position.
This fixes that so that it is moved.
Test: new test
Change-Id: I698f4dbcef46304f9aa545847d205f7b70c80d63
M transition/transition/src/androidTest/java/androidx/transition/SlideEdgeTest.java
M transition/transition/src/androidTest/java/androidx/transition/TranslationAnimationCreatorTest.java
M transition/transition/src/main/java/androidx/transition/TranslationAnimationCreator.java
ap...@google.com <ap...@google.com> #12
The following release(s) address this bug.It is possible this bug has only been partially addressed:
androidx.transition:transition:1.5.0-alpha05
ap...@google.com <ap...@google.com> #13
Branch: androidx-lifecycle-release
commit 46fef0f000d93c584c46f2a5f764475d3df4824e
Author: Sergey Vasilinets <sergeyv@google.com>
Date: Mon Oct 21 11:32:58 2019
Fix lifecycle-runtime for compileSdkVersion 28 + minification
bug: 142778206
Test: manually ran a testcase from
Change-Id: I81b47999effbd1e099a8876b9133db4f8a0d899b
(cherry picked from commit 714063ab71dff7b514b9c5f6489190c9d4fffda9)
M buildSrc/src/main/kotlin/androidx/build/LibraryVersions.kt
A lifecycle/lifecycle-common-java8/api/2.2.0-rc02.txt
A lifecycle/lifecycle-common-java8/api/public_plus_experimental_2.2.0-rc02.txt
A lifecycle/lifecycle-common-java8/api/restricted_2.2.0-rc02.txt
A lifecycle/lifecycle-common/api/2.2.0-rc02.txt
A lifecycle/lifecycle-common/api/public_plus_experimental_2.2.0-rc02.txt
A lifecycle/lifecycle-common/api/restricted_2.2.0-rc02.txt
A lifecycle/lifecycle-extensions/api/2.2.0-rc02.txt
A lifecycle/lifecycle-extensions/api/public_plus_experimental_2.2.0-rc02.txt
A lifecycle/lifecycle-extensions/api/res-2.2.0-rc02.txt
A lifecycle/lifecycle-extensions/api/restricted_2.2.0-rc02.txt
A lifecycle/lifecycle-livedata-core-ktx/api/2.2.0-rc02.txt
A lifecycle/lifecycle-livedata-core-ktx/api/public_plus_experimental_2.2.0-rc02.txt
A lifecycle/lifecycle-livedata-core-ktx/api/res-2.2.0-rc02.txt
A lifecycle/lifecycle-livedata-core-ktx/api/restricted_2.2.0-rc02.txt
A lifecycle/lifecycle-livedata-core/api/2.2.0-rc02.txt
A lifecycle/lifecycle-livedata-core/api/public_plus_experimental_2.2.0-rc02.txt
A lifecycle/lifecycle-livedata-core/api/res-2.2.0-rc02.txt
A lifecycle/lifecycle-livedata-core/api/restricted_2.2.0-rc02.txt
A lifecycle/lifecycle-livedata-ktx/api/2.2.0-rc02.txt
A lifecycle/lifecycle-livedata-ktx/api/public_plus_experimental_2.2.0-rc02.txt
A lifecycle/lifecycle-livedata-ktx/api/res-2.2.0-rc02.txt
A lifecycle/lifecycle-livedata-ktx/api/restricted_2.2.0-rc02.txt
A lifecycle/lifecycle-livedata/api/2.2.0-rc02.txt
A lifecycle/lifecycle-livedata/api/public_plus_experimental_2.2.0-rc02.txt
A lifecycle/lifecycle-livedata/api/res-2.2.0-rc02.txt
A lifecycle/lifecycle-livedata/api/restricted_2.2.0-rc02.txt
A lifecycle/lifecycle-process/api/2.2.0-rc02.txt
A lifecycle/lifecycle-process/api/public_plus_experimental_2.2.0-rc02.txt
A lifecycle/lifecycle-process/api/res-2.2.0-rc02.txt
A lifecycle/lifecycle-process/api/restricted_2.2.0-rc02.txt
M lifecycle/lifecycle-process/build.gradle
A lifecycle/lifecycle-process/proguard-rules.pro
A lifecycle/lifecycle-reactivestreams-ktx/api/2.2.0-rc02.txt
A lifecycle/lifecycle-reactivestreams-ktx/api/public_plus_experimental_2.2.0-rc02.txt
A lifecycle/lifecycle-reactivestreams-ktx/api/res-2.2.0-rc02.txt
A lifecycle/lifecycle-reactivestreams-ktx/api/restricted_2.2.0-rc02.txt
A lifecycle/lifecycle-reactivestreams/api/2.2.0-rc02.txt
A lifecycle/lifecycle-reactivestreams/api/public_plus_experimental_2.2.0-rc02.txt
A lifecycle/lifecycle-reactivestreams/api/res-2.2.0-rc02.txt
A lifecycle/lifecycle-reactivestreams/api/restricted_2.2.0-rc02.txt
A lifecycle/lifecycle-runtime-ktx/api/2.2.0-rc02.txt
A lifecycle/lifecycle-runtime-ktx/api/public_plus_experimental_2.2.0-rc02.txt
A lifecycle/lifecycle-runtime-ktx/api/res-2.2.0-rc02.txt
A lifecycle/lifecycle-runtime-ktx/api/restricted_2.2.0-rc02.txt
A lifecycle/lifecycle-runtime/api/2.2.0-rc02.txt
A lifecycle/lifecycle-runtime/api/public_plus_experimental_2.2.0-rc02.txt
A lifecycle/lifecycle-runtime/api/res-2.2.0-rc02.txt
A lifecycle/lifecycle-runtime/api/restricted_2.2.0-rc02.txt
M lifecycle/lifecycle-runtime/proguard-rules.pro
M lifecycle/lifecycle-runtime/src/main/java/androidx/lifecycle/ReportFragment.java
A lifecycle/lifecycle-service/api/2.2.0-rc02.txt
A lifecycle/lifecycle-service/api/public_plus_experimental_2.2.0-rc02.txt
A lifecycle/lifecycle-service/api/res-2.2.0-rc02.txt
A lifecycle/lifecycle-service/api/restricted_2.2.0-rc02.txt
A lifecycle/lifecycle-viewmodel-ktx/api/2.2.0-rc02.txt
A lifecycle/lifecycle-viewmodel-ktx/api/public_plus_experimental_2.2.0-rc02.txt
A lifecycle/lifecycle-viewmodel-ktx/api/res-2.2.0-rc02.txt
A lifecycle/lifecycle-viewmodel-ktx/api/restricted_2.2.0-rc02.txt
A lifecycle/lifecycle-viewmodel/api/2.2.0-rc02.txt
A lifecycle/lifecycle-viewmodel/api/public_plus_experimental_2.2.0-rc02.txt
A lifecycle/lifecycle-viewmodel/api/res-2.2.0-rc02.txt
A lifecycle/lifecycle-viewmodel/api/restricted_2.2.0-rc02.txt
an...@google.com <an...@google.com> #14
d4...@gmail.com <d4...@gmail.com> #15
-keepclassmembers class androidx.lifecycle.ReportFragment$** { *; }
ag...@google.com <ag...@google.com> #16
Sergey, doing bug cleanup, is this fixed on your end?
se...@google.com <se...@google.com> #17
Yep, it is fixed on our end
Description
Version used: Android 10
Theme used: Theme.AppCompat.Light.DarkActionBar
Devices/Android versions reproduced on:
## Details
App is stuck on `INITIALIZED` state, even the activity has already finished `onResume()` method call
## Steps to Reproduce
- Build a signed production release `apk` with proguard `minifyEnabled true` (default)
- Install on `Pixel 3a` running `Android 10`
- Tap `UPDATE STATUS` button to examine the retrieved current state
- Note that the expected word shall be `RESUMED`, as is on other devices (even on Android 10 emulator) except `Pixel 3a / Android 10`
## Notes
- `'androidx.lifecycle:lifecycle-runtime:2.1.0'` doesn't have the issue
- disable or removed `proguard` works
- code demonstrating the issue can be checked out here:
-