File tree Expand file tree Collapse file tree 1 file changed +6
-0
lines changed
app/src/main/java/com/google/samples/apps/nowinandroid/ui Expand file tree Collapse file tree 1 file changed +6
-0
lines changed Original file line number Diff line number Diff line change @@ -48,6 +48,7 @@ import androidx.compose.ui.res.painterResource
4848import androidx.compose.ui.res.stringResource
4949import androidx.compose.ui.semantics.semantics
5050import androidx.compose.ui.semantics.testTagsAsResourceId
51+ import androidx.compose.ui.zIndex
5152import androidx.lifecycle.compose.ExperimentalLifecycleComposeApi
5253import androidx.lifecycle.compose.collectAsStateWithLifecycle
5354import androidx.navigation.NavDestination
@@ -110,6 +111,11 @@ fun NiaApp(
110111 val destination = appState.currentTopLevelDestination
111112 if (destination != null ) {
112113 NiaTopAppBar (
114+ // When the nav rail is displayed, the top app bar will, by default
115+ // overlap it. This means that the top most item in the nav rail
116+ // won't be tappable. A workaround is to position the top app bar
117+ // behind the nav rail using zIndex.
118+ modifier = Modifier .zIndex(- 1F ),
113119 titleRes = destination.titleTextId,
114120 actionIcon = NiaIcons .Settings ,
115121 actionIconContentDescription = stringResource(
You can’t perform that action at this time.
0 commit comments