Fixed
Status Update
Comments
jb...@google.com <jb...@google.com> #2
Hi Ed, Thank you so much for these suggestions. I've been reviewing them and merging them in. Hopefully it should be live. I've included a thank you note too in the article.
ch...@beyls.net <ch...@beyls.net> #3
Great! Thanks a lot, I'll look for the live updates soon!
il...@google.com <il...@google.com> #4
That should already be the case - only if every fragment involved has a seeking transition/Animator will a predictive back animation happen.
Clearly that's not what is happening in your video, so we'll investigate further.
jb...@google.com <jb...@google.com>
ap...@google.com <ap...@google.com> #5
Project: platform/frameworks/support
Branch: androidx-main
commit fb6c11071111a2de175c079b4128324690b4ddd0
Author: Jeremy Woods <jbwoods@google.com>
Date: Tue May 07 22:43:45 2024
Ensure that all fragments are seekable to run preditive back
Currently, if you have a Animator or Seekable Androidx Transition on any
fragment it will always run regardless of it the other fragments in the
transaction are also seekable. We need to ensure that it is always all
or nothing, either all fragments in the transaction are seekable and we
do predictive back or one of them is not seekable and we hold the
transition.
RelNote: "Predictive back will now only run for transactions in which
all of the fragments have either a Animator or a Seekable Androidx
Transition. This fixes an issue where cancelling a partially seekable
transaction would cause a black screen."
Test: Added FragmentTransitionSeekingTest
Bug: 339169168
Change-Id: I4303795b1cb4f7e58cd4f8efe0baa53d64a51dd8
M fragment/fragment/src/main/java/androidx/fragment/app/SpecialEffectsController.kt
M transition/transition/src/androidTest/java/androidx/transition/FragmentTransitionSeekingTest.kt
https://android-review.googlesource.com/3078150
Branch: androidx-main
commit fb6c11071111a2de175c079b4128324690b4ddd0
Author: Jeremy Woods <jbwoods@google.com>
Date: Tue May 07 22:43:45 2024
Ensure that all fragments are seekable to run preditive back
Currently, if you have a Animator or Seekable Androidx Transition on any
fragment it will always run regardless of it the other fragments in the
transaction are also seekable. We need to ensure that it is always all
or nothing, either all fragments in the transaction are seekable and we
do predictive back or one of them is not seekable and we hold the
transition.
RelNote: "Predictive back will now only run for transactions in which
all of the fragments have either a Animator or a Seekable Androidx
Transition. This fixes an issue where cancelling a partially seekable
transaction would cause a black screen."
Test: Added FragmentTransitionSeekingTest
Bug: 339169168
Change-Id: I4303795b1cb4f7e58cd4f8efe0baa53d64a51dd8
M fragment/fragment/src/main/java/androidx/fragment/app/SpecialEffectsController.kt
M transition/transition/src/androidTest/java/androidx/transition/FragmentTransitionSeekingTest.kt
jb...@google.com <jb...@google.com> #6
This has been fixed internally and will be released in Fragment versions 1.7.1
and 1.8.0-beta01
.
ch...@beyls.net <ch...@beyls.net> #7
Thank you for the quick fix!
pr...@google.com <pr...@google.com> #8
The following release(s) address this bug.It is possible this bug has only been partially addressed:
androidx.fragment:fragment:1.7.1
androidx.fragment:fragment:1.8.0-beta01
pr...@google.com <pr...@google.com> #9
The following release(s) address this bug.It is possible this bug has only been partially addressed:
androidx.transition:transition:1.6.0-alpha01
Description
Version used: 1.7.0
Devices/Android versions reproduced on: Pixel 7 running Android 14
When enabling predictive back animations, the predictive back gesture now also animates transitions between fragments since Fragment 1.7.0 (in combination with the AndroidX Transition library version 1.5.0).
However, if the Fragment transition includes a shared element that uses the ChangeTransform() transition, then the animation breaks when triggered by the back gesture.
Display also ends up empty if the transition is cancelled, then both fragments are shown at the same time when navigating back. See the attached video for a demonstration.
A sample project to reproduce the issue can be cloned from: