-
Notifications
You must be signed in to change notification settings - Fork 12
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
terminate-insurance deeplink with no arg #2441
Conversation
@@ -83,7 +83,7 @@ private fun ChooseInsuranceToTerminateScreen( | |||
when (uiState) { | |||
ChooseInsuranceToTerminateStepUiState.NotAllowed -> { | |||
HedvigScaffold( | |||
navigateUp = navigateUp, | |||
navigateUp = popBackStack, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why did we change that here in this pr? 👀
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
bc with navigateUp we didn't go back to the previous app if we come from the deeplink on topAppBar icon click, so system back button and topAppBar back icon had different behaviour.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you're right about the link itself being redundant, just default null argument for destination works.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
bc with navigateUp we didn't go back to the previous app if we come from the deeplink on topAppBar icon click, so system back button and topAppBar back icon had different behaviour.
Yeah that is what we want here as per the docs https://developer.android.com/guide/navigation/principles#the_up_button_never_exits_your_app
"""
When your app is launched using a deep link on another app's task, Up transitions users back to your app’s task and through a simulated back stack and not to the app that triggered the deep link. The Back button, however, does take you back to the other app.
"""
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Right! What about the "close" textButton etc? In one of the previous pr we put popBackStack there
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, since those are not the "up" button, for those we want to emulate what the back button would do, which is what we do in here
android/app/app/src/main/kotlin/com/hedvig/android/app/navigation/RememberNavigator.kt
Lines 34 to 36 in 1f6e80c
if (!navController.popBackStack()) { | |
updatedFinishApp() | |
} |
Which is pop the backstack if possible. If not possible it means we're at the top of the backstack so finish the app
Actually a question. Would this work if we only added 1 deep link, the one with the ID and the |
No description provided.