Nat Strangerweather
07/23/2024, 5:14 PMlistPane
does not show an arrowBack icon in its TopAppBar, but the detailPane
and ExtraPane
do? I am using a ListDetailPaneScaffold
. Code in thread.Nat Strangerweather
07/23/2024, 5:14 PM@OptIn(ExperimentalMaterial3AdaptiveApi::class)
@Composable
fun AdaptiveLayout(modifier: Modifier = Modifier, mainViewModel: MainViewModel = hiltViewModel()) {
val navigator = rememberListDetailPaneScaffoldNavigator<Any>()
BackHandler(navigator.canNavigateBack()) { navigator.navigateBack() }
Scaffold(topBar = {
TopBar(
navigationIcon = {
IconButton(onClick = { navigator.navigateBack() }) {
Icon(
imageVector = Icons.AutoMirrored.Filled.ArrowBack,
contentDescription = "ArrowBack Icon"
)
}
}
)
}) { paddingValues ->
ListDetailPaneScaffold(
directive = navigator.scaffoldDirective,
value = navigator.scaffoldValue,
modifier = modifier
.padding(paddingValues),
listPane = {
AnimatedPane {
LazyColumn(
Nat Strangerweather
07/25/2024, 4:36 PMTopBar(
navigationIcon = {
if (navigator.currentDestination?.pane != ListDetailPaneScaffoldRole.List)
IconButton(onClick = {navigator.navigateBack() }) {
Icon(
imageVector = Icons.AutoMirrored.Filled.ArrowBack,
contentDescription = "ArrowBack Icon"
)
}
}
)