|
|
@ -41,17 +41,18 @@ import com.google.samples.apps.nowinandroid.feature.topic.navigation.topicScreen
|
|
|
|
import kotlinx.serialization.Serializable
|
|
|
|
import kotlinx.serialization.Serializable
|
|
|
|
|
|
|
|
|
|
|
|
@Serializable object TopicPlaceholderDestination
|
|
|
|
@Serializable object TopicPlaceholderDestination
|
|
|
|
|
|
|
|
|
|
|
|
@Serializable object DetailPaneNavHostDestination
|
|
|
|
@Serializable object DetailPaneNavHostDestination
|
|
|
|
|
|
|
|
|
|
|
|
fun NavGraphBuilder.interestsListDetailScreen() {
|
|
|
|
fun NavGraphBuilder.interestsListDetailScreen() {
|
|
|
|
composable<InterestsDestination>{
|
|
|
|
composable<InterestsDestination> {
|
|
|
|
InterestsListDetailScreen()
|
|
|
|
InterestsListDetailScreen()
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@Composable
|
|
|
|
@Composable
|
|
|
|
internal fun InterestsListDetailScreen() {
|
|
|
|
internal fun InterestsListDetailScreen() {
|
|
|
|
var selectedTopicId : String? by rememberSaveable { mutableStateOf(null) }
|
|
|
|
var selectedTopicId: String? by rememberSaveable { mutableStateOf(null) }
|
|
|
|
InterestsListDetailScreen(
|
|
|
|
InterestsListDetailScreen(
|
|
|
|
selectedTopicId = selectedTopicId,
|
|
|
|
selectedTopicId = selectedTopicId,
|
|
|
|
onTopicClick = { topicId -> selectedTopicId = topicId },
|
|
|
|
onTopicClick = { topicId -> selectedTopicId = topicId },
|
|
|
@ -92,8 +93,8 @@ internal fun InterestsListDetailScreen(
|
|
|
|
NavHost(
|
|
|
|
NavHost(
|
|
|
|
navController = nestedNavController,
|
|
|
|
navController = nestedNavController,
|
|
|
|
startDestination = TopicPlaceholderDestination::class,
|
|
|
|
startDestination = TopicPlaceholderDestination::class,
|
|
|
|
route = DetailPaneNavHostDestination::class
|
|
|
|
route = DetailPaneNavHostDestination::class,
|
|
|
|
){
|
|
|
|
) {
|
|
|
|
topicScreen(
|
|
|
|
topicScreen(
|
|
|
|
showBackButton = !listDetailNavigator.isListPaneVisible(),
|
|
|
|
showBackButton = !listDetailNavigator.isListPaneVisible(),
|
|
|
|
onBackClick = listDetailNavigator::navigateBack,
|
|
|
|
onBackClick = listDetailNavigator::navigateBack,
|
|
|
|