architecture-components-samples
architecture-components-samples copied to clipboard
bugs NavigationAdvancedSample : screen white
I have tried navigation adventure (demo), it looks good and it is intuitive; however, It has come to my attention that after performing a stress test on the navigation buttons, it bugs: the screen whitens out
Duplicate of #773
I solved the problem.The problem is the timing of the animation call.
You just need to change it.
fragmentManager.beginTransaction() .setCustomAnimations( R.anim.nav_default_enter_anim, R.anim.nav_default_exit_anim, R.anim.nav_default_pop_enter_anim, R.anim.nav_default_pop_exit_anim) .attach(selectedFragment) .setPrimaryNavigationFragment(selectedFragment) .apply { // Detach all other Fragments graphIdToTagMap.forEach { _, fragmentTagIter -> if (fragmentTagIter != newlySelectedItemTag) { detach(fragmentManager.findFragmentByTag(firstFragmentTag)!!) } } } .addToBackStack(firstFragmentTag) .setReorderingAllowed(true) .commit()
after modification.
fragmentManager.beginTransaction() .attach(selectedFragment) .setPrimaryNavigationFragment(selectedFragment) .apply { // Detach all other Fragments graphIdToTagMap.forEach { _, fragmentTagIter -> if (fragmentTagIter != newlySelectedItemTag) { detach(fragmentManager.findFragmentByTag(firstFragmentTag)!!) } } } .addToBackStack(firstFragmentTag) .setCustomAnimations( R.anim.nav_default_enter_anim, R.anim.nav_default_exit_anim, R.anim.nav_default_pop_enter_anim, R.anim.nav_default_pop_exit_anim) .setReorderingAllowed(true) .commit()
@fadibouteraa In the NavigationAdvancedSample, navigation is 2.2.0-alpha01, modified to 2.1.0.And all beta versions will be corrected.