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

[do not merge] Update navigation usage #95

Closed

Conversation

jdkoren
Copy link

@jdkoren jdkoren commented Aug 29, 2024

No description provided.

Previously, the app had a NavHost but didn't actually call navigate.
NavHost's startDestination was read from external state (the currently
selected nav item), which led to some undesirable behaviors.
- NavHost itself was recomposed when selecting a nav item.
- Pressing back always exited the app because you were always at the
  start destination.

Now the NavHost has a stable startDestination, and nav item state is
driven by the NavHostController's current destination. Selecting a nav
item calls navigate, and the user always goes back through the
startDestination before exiting the app.
@jdkoren
Copy link
Author

jdkoren commented Aug 29, 2024

I just now realized there is another NavHost in Main.kt, so this change might not be warranted or complete.

@jdkoren jdkoren changed the title Update navigation usage [do not merge] Update navigation usage Aug 29, 2024
@jdkoren
Copy link
Author

jdkoren commented Sep 5, 2024

Filed #96 regarding the use of multiple NavHosts. Open to suggestions about what to do with this PR in light of that.

Base automatically changed from jdk/codelab_2024_fixup to codelab_improve_android_experience_2024 October 2, 2024 17:07
@jdkoren
Copy link
Author

jdkoren commented Oct 15, 2024

superceded by #102

@jdkoren jdkoren closed this Oct 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant