-
Notifications
You must be signed in to change notification settings - Fork 76
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Cherry Pick] Use one NavHost (with a single navigation scaffold) (#102)
* Deduplicate lifecycle runtime compose * kotlin 2.0 and compose gradle plugin * update test & other versions * Call navigate instead of recomposing HavHost 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. * Use type-safe navigation * Make a package for navigation routes * Migrate to type safe routes for main navhost * Push Scaffold down to each top-level destination * Extract nav suite scaffold to another composable * Move ChatList, move and rename HomeViewModel * Move Settings to its own package * Remove Home and put its destinations in Main NavHost * Remove Home composable and rename file * Add NavigationSuiteScaffold around NavHost * Change navigation layout type based on current destination
- Loading branch information
Showing
17 changed files
with
529 additions
and
459 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.