Fixed
Status Update
Comments
il...@google.com <il...@google.com>
il...@google.com <il...@google.com> #2
Project: platform/frameworks/support
Branch: androidx-master-dev
commit e005db789e4c6b6c75fb8ca03a0c4e326868fb91
Author: Jeremy Woods <jbwoods@google.com>
Date: Wed Sep 02 14:20:41 2020
Move nav_default animation out of animation sets
All of the nav_default animations are simple fades and do not need to be
inside of a animation set. Moving them out also ensures that if they are
placed in an additional set (i.e. like the new fragment state manager
does to listen for when the animation finishes) they will not flash.
Bug: 167430145
Test: Tested in sample app
Change-Id: I071e922a52301863ba2461ff05b60bb64566430c
M navigation/navigation-ui/src/main/res/anim/nav_default_enter_anim.xml
M navigation/navigation-ui/src/main/res/anim/nav_default_exit_anim.xml
M navigation/navigation-ui/src/main/res/anim/nav_default_pop_enter_anim.xml
M navigation/navigation-ui/src/main/res/anim/nav_default_pop_exit_anim.xml
https://android-review.googlesource.com/1418719
Branch: androidx-master-dev
commit e005db789e4c6b6c75fb8ca03a0c4e326868fb91
Author: Jeremy Woods <jbwoods@google.com>
Date: Wed Sep 02 14:20:41 2020
Move nav_default animation out of animation sets
All of the nav_default animations are simple fades and do not need to be
inside of a animation set. Moving them out also ensures that if they are
placed in an additional set (i.e. like the new fragment state manager
does to listen for when the animation finishes) they will not flash.
Bug: 167430145
Test: Tested in sample app
Change-Id: I071e922a52301863ba2461ff05b60bb64566430c
M navigation/navigation-ui/src/main/res/anim/nav_default_enter_anim.xml
M navigation/navigation-ui/src/main/res/anim/nav_default_exit_anim.xml
M navigation/navigation-ui/src/main/res/anim/nav_default_pop_enter_anim.xml
M navigation/navigation-ui/src/main/res/anim/nav_default_pop_exit_anim.xml
Description
Version used: alpha 0.0.5
Devices/Android versions reproduced on: Android 8.1 Oneplus 3T, Android 6.0 Moto G Turbo edition
I made a sample project which consists of a main activity and 2 fragments, FragmentA and FragmentB
Fragment A has a button to fragment B
Fragment B simply states that you are on fragment B
The main activity listens for and logs which page you are on when you navigate
The main activity has 4 buttons
1 - Pop - Calls navigation controllers popBackStack() method
1 - Pop to root - Calls navigation controllers popBackStack() method with fragment A as a destination and inclusive set to false, so you get back to the top of the stack
3 - Up - calls navigation controllers navigateUp method
4 - Check page, gives a toast with the current destinations label
The bugs:
1) If you press pop when on the home screen, you end up still on the home screen but the navigation controller seems to forget where it is. The current destination becomes null but im still on page a. I can still go to page b too. But once on page b, all further navigation fails. Not sure if this is a bug or intentional
2) To get around this i used pop to root instead. This one works fine most the time but if you hit the button for going to fragment b and simultaneously hit the pop to root button, sometimes, if you time it right, it breaks the backstack. The current destination button tells me I'm on A, the backstack size (checked via debugger) also suggests I'm on A, and therefore pop and pop to root both stop working (since it thinks I'm already at the top). Yet I see B on my screen. Checking the navigation listener, it thinks im on A too (that's the last thing logged). I'm assuming some sort of race condition or something is causing this.
When the backstack is broken in either of these 2 ways, i can still use the up button, but it causes the activity to recreate (judging by the code, i think it thinks I'm deep linked into fragment B)
Also when it is broken via
The sample project is attached.