-
Notifications
You must be signed in to change notification settings - Fork 147
🛤️ Migrate to the Compose Multiplatform Navigation #779
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
Merged
Conversation
This file contains hidden or 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
f2fa0d4
to
adafe7d
Compare
59f1d60
to
c7453d8
Compare
a13211a
to
229880c
Compare
229880c
to
b85c92b
Compare
A new Compose Navigation dependency was added once Voyager doesn't seem to be maintained anymore.
New destinations and events were created to represent all the app's screens and how to interact between them.
Initial structure connecting the AndroidX Navigation with our custom implementation created.
All the existing destinations were migrated from Voyager to the new navigation system. Future commits will handle the deep links and port more destinations (such as confirmation dialogs) to this system.
Bye, bye, my friend!
Name updated
Since Compose Multiplatform does not fully support deep links, the initial implementation was created, and it will be updated when the support is ready. For now, every deep link will simply open Alkaa's main screen.
A new module and a Wrapper to provide the `PermissionsController` instance. This class holds a single instance of `PermissionsController` since Moko does not allow `BindEffect` to be called outside an Activity context (Alkaa uses in a `dialog` destination).
The behavior for keep the tab state after rotating the screen was re-introduced. Small changes were needed to ensure the data can be properly stored in the `Bundle`.
After the recent updates, the `rememberSaveable` for the `LocalDateTime` was not working properly. For now, the value will be stored as a `Long` and converted to DateTime as needed.
Adding ModalBottomSheet implementations to show the content in a BottomSheet for the Category Edit/Add and Task Add.
Additional functions called to improve the navigation. The improvements are: - Avoid navigating to the same place if it's already on top - Save and restore state for the TopLevel destinations
New module created to avoid circular dependencies. Ideally, the interfaces from `navigation` should be moved here. For now, it is what it is. 😀
A new structure was created to emit the changes in the Top Level destinations and update the Bottom Navigation (or NavRail) and the Top App Bar. The solution is based on the official Navigation Compose documents and Now in Android project.
The build task is failing even though the app is working fine. Time to fix.
The `HomeScreenTest` was updated to add test case for tab change after back button: - Added a test that checks if when the tab is changed and back button is pressed, the title updates correctly. - Modified the existing title verification to ensure the correct element is asserted for being selected.
After further investigation, I found out that the iOS tests doesn't have `LocalLifecycleOwner` by design, apparently since the "actual" implementation simply throws an exception. The solution was to create a fake `LifecycleOwner` to be used on the tests. In addition, a test in `CategoryFlowTest` was update to not be flaky on iOS.
Previously, the code was defaulting to Task if the destination was not found as a TopLevel. This creates problems when the Top App Bar is visible and a non top-level is the current destination. In these cases, it would show the "About" screen with the "Tasks" title. To fix this the find will return null if it's not a TopLevel and `filterNotNull` was added to ensure there will be no emission on this case, leaving the current title active.
The following changes were proposed in this commit: - Add a marker interface to check if the TopAppBar should be visible. - Implement the state control for the TopAppBar visibility. - Add a list of all destinations that the TopAppBar should be visible. - Update the home screen to animate the visibility of the TopAppBar. - Add transition animation for TaskDetail screen.
More files were moved to make most of the clients depend only on in the API module instead.
The Navigation modules (both the implementation and the API) were moved from the 'libraries' folder to the 'features' folder.
There was a bug when switching TopLevel destinations with saved backstack. Since the `currentTopDestination` was only returning the current entry, it was not possible to get the TopLevel where this destination was started, making the Bottom Bar icon not updating correctly. The top level destination is now obtained from the backstack, instead of only from the current entry. This allows the app to properly detect the correct top level screen when navigating back.
To be more aligned with other apps, a new behavior was introduced where the stack is clear when the current BottomBar item (TopLevel) is clicked. This required not only a change in how to save and restore but additional work to ensure the navigation won't blink when this happens.
Improve the animations for the transition between destinations and the TopBar.
b85c92b
to
48c4a6d
Compare
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Migrating to the new Compose Multiplatform Navigation library and implementing a new navigation system based on events.
Fix #661