Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Navigation Animation] Avoid crashing when the start destination changes #1243

Merged
merged 1 commit into from Jul 13, 2022

Commits on Jul 12, 2022

  1. Avoid crashing when the start destination changes

    Since moving to using visibleEntries, if you change your start
    destination dynamically, instead of dropping the graph and rebuilding,
    the AnimatedNavHost crashes.
    
    The reason for this crash is that setting the graph synchronously pops
    the entire back stack, which clears all of the visibleEntries so there
    is a frame in AnimatedNavHost where it fails to find any of the old
    entries.
    
    We should move setNavGraph over to using the popWithTransition function,
    but there is pre-req works that needs to be done. So as a stop gap, we
    will return null from visibleEntries and disable the animations on
    AnimatedNavHost.
    
    Fixes google#1162
    Jeremy Woods committed Jul 12, 2022
    Copy the full SHA
    3bc0775 View commit details
    Browse the repository at this point in the history