Update to adaptive alpha12, fix merge issues

Change-Id: I99703db37712abb46b844beb73bb14ddd5283165
dt/nav-safe-args-android-dependency
Don Turner 6 months ago
parent f711e69cd2
commit 68152e5056

@ -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)

@ -10,7 +10,7 @@ androidxBrowser = "1.8.0"
androidxComposeBom = "2024.02.02" androidxComposeBom = "2024.02.02"
androidxComposeCompiler = "1.5.8" androidxComposeCompiler = "1.5.8"
androidxComposeUiTest = "1.7.0-alpha06" androidxComposeUiTest = "1.7.0-alpha06"
androidxComposeMaterial3Adaptive = "1.0.0-alpha10" androidxComposeMaterial3Adaptive = "1.0.0-alpha12"
androidxComposeRuntimeTracing = "1.0.0-beta01" androidxComposeRuntimeTracing = "1.0.0-beta01"
androidxCore = "1.12.0" androidxCore = "1.12.0"
androidxCoreSplashscreen = "1.0.1" androidxCoreSplashscreen = "1.0.1"

Loading…
Cancel
Save