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

Set up top level navigation #240

Open
wants to merge 1 commit into
base: kotlinconf-2025
Choose a base branch
from
Open

Set up top level navigation #240

wants to merge 1 commit into from

Conversation

zsmb13
Copy link
Contributor

@zsmb13 zsmb13 commented Jan 18, 2025

Fixes #236

This PR updates the navigation setup of the app the following way:

  • Most screens are kept at the top level as before, within the root nav controller
  • The onboarding flow "start screens" are in their own little nested nav graph
    • For now, there's a fake Flow that produces a random true/false value for whether the onboarding has been completed, we'll hook this up to actual preference storage later. This means the onboarding flow is skipped 50% of the time.
  • The new HomeScreen component serves the screen with 4-button bottom navigation between its destinations. This can't be a nested nav graph as there's also common UI that persists through the screens (the bottom navigation bar), so it's a destination that contains a second NavHost that navigates within the HomeScreen destinations.
    • The Compose version bumps are needed for this nesting to work, as the new versions include this bugfix

@@ -20,7 +25,9 @@ class MainActivity : ComponentActivity() {
)

setContent {
App(context)
Box(Modifier.windowInsetsPadding(WindowInsets.systemBars)) {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Adding some basic insets here just to make buttons clickable, we'll need to do proper insets work later

@zsmb13 zsmb13 force-pushed the top-level-nav branch 5 times, most recently from 6a071b2 to 56937c2 Compare January 18, 2025 21:54
@zsmb13 zsmb13 changed the title WIP set up top level navigation Set up top level navigation Jan 18, 2025
@zsmb13 zsmb13 marked this pull request as ready for review January 18, 2025 22:01
@zsmb13 zsmb13 requested a review from kropp January 18, 2025 22:01
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