What is the intended way to have the system naviga...
# compose
m
What is the intended way to have the system navigation bar be the same color as the Material 3 navigation bar? I can set the system navigation bar color, but I don't know the Material 3 navigation bar color as it changes automatically with tonal color.
1
a
Set it to fully transparent and use insets within your content
r
agree with adam, this is my solution:
Copy code
@Composable
fun Md3BottomNavigation(
    content: @Composable RowScope.() -> Unit
) {
    Surface(
        tonalElevation = 3.dp
    ) {
        CompositionLocalProvider(
            LocalAbsoluteTonalElevation provides LocalAbsoluteTonalElevation.current - 3.dp
        ) {
            NavigationBar(
                modifier = Modifier.navigationBarsPadding()
            ) {
                content()
            }
        }
    }
}
m
Thanks both, this worked nicely.
👍 1