Compose Modifier

windowInsetsBottomHeight

Sets the height to that of [insets] at the [bottom][WindowInsets.

insetsBottomHeightSample

fun insetsBottomHeightSample() {
    class SampleActivity : ComponentActivity() {
        override fun onCreate(savedInstanceState: Bundle?) {
            WindowCompat.setDecorFitsSystemWindows(window, false)
            super.onCreate(savedInstanceState)
            setContent {
                Box(Modifier.fillMaxSize()) {
                    // Background for navigation bar at the bottom
                    Box(
                        Modifier.windowInsetsBottomHeight(WindowInsets.navigationBars)
                            .fillMaxWidth()
                            .align(Alignment.BottomCenter)
                            .background(Color.Red)
                    )
                    // app content
                }
            }
        }
    }
}