-
Notifications
You must be signed in to change notification settings - Fork 206
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
[Proposal] ♻️ Added the ability to go to the floor map from the session details. #1127
base: main
Are you sure you want to change the base?
[Proposal] ♻️ Added the ability to go to the floor map from the session details. #1127
Conversation
class DefaultNavigationRequester : NavigationRequester { | ||
private val _navigateRequestStateFlow = MutableStateFlow("") | ||
override fun getNavigationRouteFlow(): Flow<String> = _navigateRequestStateFlow | ||
|
||
override fun navigateTo(route: String) { | ||
_navigateRequestStateFlow.value = route | ||
} | ||
|
||
override fun navigated() { | ||
_navigateRequestStateFlow.value = "" | ||
} | ||
} |
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.
We did this to operate between different NavHosts.
I don't think this is the best way to do it, so if you have a better idea, I'm open to it.
I doubt if the name NavigationRequester is appropriate either.
Hi @Corvus400! Codes seem to be unformatted. To resolve this issue, please run |
…ontent_detail' into feature/move_to_floor_map_from_content_detail
@@ -109,6 +112,10 @@ fun TimetableItemDetailScreen( | |||
onNavigationIconClick = onNavigationIconClick, | |||
onBookmarkClick = viewModel::onBookmarkClick, | |||
onLinkClick = onLinkClick, | |||
onRoomClick = { | |||
viewModel.navigateTo("floorMap") |
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.
I would like to change this part if possible since it is directly specified.
It would be helpful if FloorMapScreenRoute could be referenced in this case.
@@ -111,6 +111,9 @@ private fun KaigiNavHost( | |||
onTimetableItemClick = navController::navigateToTimetableItemDetailScreen, | |||
onNavigateToBookmarkScreenRequested = navController::navigateToBookmarkScreen, | |||
onLinkClick = externalNavController::navigate, | |||
onRoomClick = { | |||
navController.popBackStack(navController.graph.startDestinationId, false) |
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.
Well, it's difficult to think but what if we create navController::navigateToMainFloorMapScreen
?
I think we can see parent navController to access getBackStackEntry 👀
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.
Once I was able to return to the start destination with the following code.
fun NavController.navigateToMainFloorMapScreen() {
getBackStackEntry(timetableItemDetailScreenRoute).destination.parent?.startDestinationId?.let {
navigate(it)
// TODO navigateMainFloorMap
}
}
However, I have not figured out how to move to FloorMapScreen from here without having to make any major changes.
Do you already have any ideas? 🙇
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.
I'm not sure about this. But I think we can pass the route
parameter to NavHost and we may be able to pass /main/floorMap.
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.
@takahirom
I have tried the suggested method, but unfortunately the app crashes. 🙇
We still think that as long as NavHost is split into two, it is unfortunately difficult to achieve this functionality other than this current implementation. 🙇
Issue
Overview (Required)
Movie (Optional)
after.mp4