Fixed
Status Update
Comments
ku...@google.com <ku...@google.com> #2
Thank you for reporting this issue. For us to further investigate this issue, please provide the following additional information:
Steps to reproduce
Please provide a sample application or apk to reproduce the issue.
Also kindly mention the steps to be followed for reproducing the issue with the given sample application.
Screen Record of the Issue
Please capture screen record or video of the issue using following steps:
adb shell screenrecord /sdcard/video.mp4
Subsequently use following command to pull the recorded file:
adb pull /sdcard/video.mp4
Attach the file to this issue.
Steps to reproduce
Please provide a sample application or apk to reproduce the issue.
Also kindly mention the steps to be followed for reproducing the issue with the given sample application.
Screen Record of the Issue
Please capture screen record or video of the issue using following steps:
adb shell screenrecord /sdcard/video.mp4
Subsequently use following command to pull the recorded file:
adb pull /sdcard/video.mp4
Attach the file to this issue.
ku...@google.com <ku...@google.com> #3
Please provide the information as requested in comment #2 , For us to further investigate this issue.
[Deleted User] <[Deleted User]> #4
I attached a project to reproduce the issue and a screen record of it.
To reproduce the issue press the "Go to other" button on the middle of the screen and notice that OtherActivity opens with an animation. Then press back and notice how pop is done with the default animation.
However, if you check the navigation graph (nav_graph.xml), you can see it has animations for both cases.
To reproduce the issue press the "Go to other" button on the middle of the screen and notice that OtherActivity opens with an animation. Then press back and notice how pop is done with the default animation.
However, if you check the navigation graph (nav_graph.xml), you can see it has animations for both cases.
ku...@google.com <ku...@google.com> #5
Thank you for reporting this issue. We have shared this with our product and engineering team and will update this issue with more information as it becomes available.
il...@google.com <il...@google.com> #6
You need to manually call NavOptions.applyPopAnimationsToPendingTransition() in your second activity:
https://developer.android.com/reference/androidx/navigation/NavOptions.html#applyPopAnimationsToPendingTransition(android.app.Activity)
We'll leave this open to ensure the documentation mentions this requirement.
We'll leave this open to ensure the documentation mentions this requirement.
il...@google.com <il...@google.com>
ya...@gmail.com <ya...@gmail.com> #7
Regarding this issue, as of 1.0.0-rc01, popEnterAnim works but popExitAnim doesn't. I was curious why, and noticed there is a small typo in the source code here:
https://github.com/aosp-mirror/platform_frameworks_support/blob/androidx-master-dev/navigation/runtime/src/main/java/androidx/navigation/ActivityNavigator.java#L80
it should be EXTRA_POP_EXIT_ANIM instead of EXTRA_POP_ENTER_ANIM.
Don't think that'll fix the issue, but it's still a small fix
it should be EXTRA_POP_EXIT_ANIM instead of EXTRA_POP_ENTER_ANIM.
Don't think that'll fix the issue, but it's still a small fix
il...@google.com <il...@google.com> #8
ya...@gmail.com <ya...@gmail.com> #9
Thanks!
il...@google.com <il...@google.com> #10
Note that as of https://issuetracker.google.com/issues/122413117 and Navigation 1.0.0-alpha10, this method has moved to ActivityNavigator: https://developer.android.com/reference/androidx/navigation/ActivityNavigator.html#applyPopAnimationsToPendingTransition(android.app.Activity)
Therefore the documentation should be updated to reflect that you need to call this method:
1) Directly after you manually finish() the activity
2) Any other times your activity can be closed, such as at the end of onBackPressed() (which internally finishes your activity)
Therefore the documentation should be updated to reflect that you need to call this method:
1) Directly after you manually finish() the activity
2) Any other times your activity can be closed, such as at the end of onBackPressed() (which internally finishes your activity)
Description
Version used: 1.0.0-alpha01
Theme used: Theme.AppCompat.Light.DarkActionBar
Devices/Android versions reproduced on: OnePlus 5T
When navigating to a new activity, the enter/exit anim are applied but the pop ones are not.
Example graph:
<?xml version="1.0" encoding="utf-8"?>
<navigation
xmlns:app="
xmlns:android="
xmlns:tools="
app:startDestination="@id/mainFragment">
<fragment
android:id="@+id/mainFragment"
android:name="com.kakai.android.navigationtest.presentation.navigation.MainFragment"
android:label="main_fragment"
tools:layout="@layout/main_fragment">
<action
android:id="@+id/action_mainFragment_to_otherActivity"
app:destination="@id/otherActivity"
app:enterAnim="@anim/enter_slide_left"
app:exitAnim="@anim/stay"
app:popEnterAnim="@anim/stay"
app:popExitAnim="@anim/exit_slide_left"/>
</fragment>
<activity
android:id="@+id/otherActivity"
android:name="com.kakai.android.navigationtest.presentation.other.OtherActivity"
android:label="OtherActivity"/>
</navigation>
Upon inspecting the code, we can see in ActivityNavigator line 140 that the transitions are added to the bundle but it never retrieves them from the bundle. I believe overridePendingTransitions should be called on line 80 of the same file, after retrieving the animations from the bundle.