Status Update
Comments
il...@google.com <il...@google.com>
jb...@google.com <jb...@google.com> #2
This is an issue with Animations/Animators that has been present in fragments since before 1.3.0
. setCustomAnimations()
you can call the following in the onCreate()
of your fragment:
enterTransition = Slide().apply {
slideEdge = Gravity.END
}
exitTransition = Slide().apply {
slideEdge = Gravity.START
}
ap...@google.com <ap...@google.com> #3
Branch: androidx-main
commit 4c702a921f39729d3d8e5af981a787c25b195ff1
Author: Jeremy Woods <jbwoods@google.com>
Date: Fri Mar 12 15:43:49 2021
Ensure fragments animate in the same direction
When using the new state manager, the last fragment operation should
always determine the direction of the special effects. So if the
transactions are forward -> forward -> pop, the special effects should
all be pop type since the last transaction was a pop.
RelNote: "When running both `popBackStack()` and `commit()` operations
together, the last operation will now set the direction for all
animations rather than running some pop animations and some enter
animations."
Test: removePopExitAnimation
Bug: 181142246
Change-Id: I7072e2c8008318ae812ae461a42ddafbbe6055cd
M fragment/fragment/src/androidTest/java/androidx/fragment/app/FragmentAnimationTest.kt
M fragment/fragment/src/main/java/androidx/fragment/app/BackStackRecord.java
M fragment/fragment/src/main/java/androidx/fragment/app/DefaultSpecialEffectsController.java
M fragment/fragment/src/main/java/androidx/fragment/app/Fragment.java
M fragment/fragment/src/main/java/androidx/fragment/app/FragmentAnim.java
M fragment/fragment/src/main/java/androidx/fragment/app/FragmentManager.java
jb...@google.com <jb...@google.com> #4
This has been fixed internally and will be available in the Fragment 1.3.2
release.
el...@gmail.com <el...@gmail.com> #5
Hi,
Changes in 1.3.2 seems to create issues when using a navController. In our app we navigate between fragments like this:
findMasterNavController().navigate(Uri.parse(deepLink), NavOptions.Builder().setEnterAnim(R.anim.enter_left)
.setExitAnim(R.anim.exit_right)
.setPopEnterAnim(R.anim.enter_right)
.setPopExitAnim(R.anim.exit_left)
.build())
Then when pressing the back button, the exit anim isn't played.
Cheers,
il...@google.com <il...@google.com> #6
Re #5 - please file a new bug with a sample project that reproduces your issue.
pr...@gmail.com <pr...@gmail.com> #7
el...@gmail.com <el...@gmail.com> #8
#6, seems someone already did it:
Description
Component used: Fragment
Version used: 1.3.0
Devices/Android versions reproduced on: Pixel 3 XL Android 11
I am observing a case where popExit animation plays instead of exit animation. It happens in the following conditions:
When I debug the fragment library code, what I see is:
Sample project:https://github.com/mkano9/material-container-transform-recycleChildrenOnDetach/tree/popexit-and-exit-reversed
Video attached.