Does anybody know what I can do so that my `listPa...
# compose-android
n
Does anybody know what I can do so that my
listPane
does not show an arrowBack icon in its TopAppBar, but the
detailPane
and
ExtraPane
do? I am using a
ListDetailPaneScaffold
. Code in thread.
Copy code
@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(
In case someone sees this one day, the solution is this:
Copy code
TopBar(
            navigationIcon = {
                if (navigator.currentDestination?.pane != ListDetailPaneScaffoldRole.List)
                IconButton(onClick = {navigator.navigateBack() }) {
                    Icon(
                        imageVector = Icons.AutoMirrored.Filled.ArrowBack,
                        contentDescription = "ArrowBack Icon"
                    )
                }
            }
        )