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
Recreate nested nav to work with AnimatedPane #1380
Merged
Merged
Conversation
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
Combined test coverage report
Files
|
alexvanyo
force-pushed
the
av/nested-nav-with-animated-pane
branch
from
April 16, 2024 00:32
6fce017
to
8b9bc76
Compare
Combined test coverage report
Files
|
Combined test coverage report
Files
|
jdkoren
reviewed
Apr 16, 2024
...n/kotlin/com/google/samples/apps/nowinandroid/ui/interests2pane/InterestsListDetailScreen.kt
Show resolved
Hide resolved
alexvanyo
force-pushed
the
av/nested-nav-with-animated-pane
branch
from
April 17, 2024 01:15
e1b4679
to
0b1e65c
Compare
Combined test coverage report
Files
|
jdkoren
approved these changes
Apr 25, 2024
Change-Id: I6b526331b7fc62b968ac39e91753a8a1e5343023
Change-Id: If1155bfbe080eb4df3c59faaec0fb4cd4da3821d
alexvanyo
force-pushed
the
av/nested-nav-with-animated-pane
branch
from
May 3, 2024 21:57
0b1e65c
to
c2fc34c
Compare
Combined test coverage report
Files
|
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.
Adds
AnimatedPane
toListDetailPaneScaffold
for interests by introducing a workaround for the nested navigation host setup.Previously, adding
AnimatedPane
would crash when just the list was showing, since we'd try to callnavigate
on the nested nav controller before the graph for the nested nav controller was setup.The workaround in this PR is to only call
navigate
on the nested nav controller in the situation where both the list and detail are showing.If just the list is showing, then instead of calling navigate on the nested nav controller, we completely tear-down and recreate the nested nav controller and the nested
NavHost
via akey
on a unique id. Then, the start destination of the nested nav host becomes where we were trying to navigate to.Since we were popping the nested nav controller anyway, we don't mind that we completely wipe the state of the nested nav host in this situation.