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

Introduce top-level Navigator as the entry point for all navigation #41

Merged
merged 14 commits into from
May 21, 2024

Conversation

jayohms
Copy link
Contributor

@jayohms jayohms commented May 21, 2024

Previously in turbo-android, the library was structured like:

SessionNavHostFragment
  -> Session
    -> WebView

This makes substantial changes to make the library more inline with the iOS library. Instead of navigation APIs existing in multiple places, such as the *ActivityDelegate and the *Destination interfaces, all navigation flows through a single Navigator API. The structure looks like:

NavigatorHost
  -> Navigator
    -> Session
      -> WebView

This reduces the need to ever interact directly with a NavHostFragment or a Session. The Navigator (available in the HotwireActivity and every destination screen) provides all the navigation APIs an app needs:

navigator.route(url)
navigator.pop()
navigator.clearAll()
navigator.reset()

@jayohms jayohms merged commit a64ea77 into main May 21, 2024
1 check passed
@jayohms jayohms deleted the navigator branch May 21, 2024 16:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

1 participant