|
|
@ -104,19 +104,17 @@ internal fun InterestsListDetailScreen(
|
|
|
|
|
|
|
|
|
|
|
|
fun onTopicClickShowDetailPane(topicId: String) {
|
|
|
|
fun onTopicClickShowDetailPane(topicId: String) {
|
|
|
|
onTopicClick(topicId)
|
|
|
|
onTopicClick(topicId)
|
|
|
|
|
|
|
|
if (listDetailNavigator.isDetailPaneVisible()) {
|
|
|
|
// TODO (merge): Fix this
|
|
|
|
|
|
|
|
//if (listDetailNavigator.isDetailPaneVisible()) {
|
|
|
|
|
|
|
|
// If the detail pane was visible, then use the nestedNavController navigate call
|
|
|
|
// If the detail pane was visible, then use the nestedNavController navigate call
|
|
|
|
// directly
|
|
|
|
// directly
|
|
|
|
nestedNavController.navigateToTopic(topicId) {
|
|
|
|
nestedNavController.navigateToTopic(topicId) {
|
|
|
|
popUpTo<DetailPaneNavHostDestination>()
|
|
|
|
popUpTo<DetailPaneNavHostDestination>()
|
|
|
|
}
|
|
|
|
}
|
|
|
|
/*} else {
|
|
|
|
} else {
|
|
|
|
// Otherwise, recreate the NavHost entirely, and start at the new destination
|
|
|
|
// Otherwise, recreate the NavHost entirely, and start at the new destination
|
|
|
|
nestedNavHostStartDestination = TopicDestination(id = topicId)
|
|
|
|
nestedNavHostStartDestination = TopicDestination(id = topicId)
|
|
|
|
nestedNavKey = UUID.randomUUID()
|
|
|
|
nestedNavKey = UUID.randomUUID()
|
|
|
|
}*/
|
|
|
|
}
|
|
|
|
listDetailNavigator.navigateTo(ListDetailPaneScaffoldRole.Detail)
|
|
|
|
listDetailNavigator.navigateTo(ListDetailPaneScaffoldRole.Detail)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -124,22 +122,19 @@ internal fun InterestsListDetailScreen(
|
|
|
|
value = listDetailNavigator.scaffoldValue,
|
|
|
|
value = listDetailNavigator.scaffoldValue,
|
|
|
|
directive = listDetailNavigator.scaffoldDirective,
|
|
|
|
directive = listDetailNavigator.scaffoldDirective,
|
|
|
|
listPane = {
|
|
|
|
listPane = {
|
|
|
|
// TODO (merge): Fix this
|
|
|
|
AnimatedPane {
|
|
|
|
//AnimatedPane {
|
|
|
|
|
|
|
|
InterestsRoute(
|
|
|
|
InterestsRoute(
|
|
|
|
onTopicClick = ::onTopicClickShowDetailPane,
|
|
|
|
onTopicClick = ::onTopicClickShowDetailPane,
|
|
|
|
highlightSelectedTopic = listDetailNavigator.isDetailPaneVisible(),
|
|
|
|
highlightSelectedTopic = listDetailNavigator.isDetailPaneVisible(),
|
|
|
|
)
|
|
|
|
)
|
|
|
|
//}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
},
|
|
|
|
detailPane = {
|
|
|
|
detailPane = {
|
|
|
|
// TODO (merge): Fix this
|
|
|
|
AnimatedPane {
|
|
|
|
//AnimatedPane {
|
|
|
|
key(nestedNavKey) {
|
|
|
|
// key(nestedNavKey) {
|
|
|
|
|
|
|
|
NavHost(
|
|
|
|
NavHost(
|
|
|
|
navController = nestedNavController,
|
|
|
|
navController = nestedNavController,
|
|
|
|
startDestination = nestedNavHostStartDestination,
|
|
|
|
startDestination = nestedNavHostStartDestination
|
|
|
|
route = DetailPaneNavHostDestination::class,
|
|
|
|
|
|
|
|
) {
|
|
|
|
) {
|
|
|
|
topicScreen(
|
|
|
|
topicScreen(
|
|
|
|
showBackButton = !listDetailNavigator.isListPaneVisible(),
|
|
|
|
showBackButton = !listDetailNavigator.isListPaneVisible(),
|
|
|
@ -150,17 +145,10 @@ internal fun InterestsListDetailScreen(
|
|
|
|
TopicDetailPlaceholder()
|
|
|
|
TopicDetailPlaceholder()
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
// }
|
|
|
|
}
|
|
|
|
//}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
},
|
|
|
|
)
|
|
|
|
)
|
|
|
|
// TODO (merge): Remove
|
|
|
|
|
|
|
|
LaunchedEffect(Unit) {
|
|
|
|
|
|
|
|
if (selectedTopicId != null) {
|
|
|
|
|
|
|
|
// Initial topic ID was provided when navigating to Interests, so show its details.
|
|
|
|
|
|
|
|
onTopicClickShowDetailPane(selectedTopicId)
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@OptIn(ExperimentalMaterial3AdaptiveApi::class)
|
|
|
|
@OptIn(ExperimentalMaterial3AdaptiveApi::class)
|
|
|
|