Compose Modifier

windowInsetsEndWidth

Sets the width to that of [insets] at the [end][androidx.

insetsEndWidthSample

fun insetsEndWidthSample() {
    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 end
                    Box(
                        Modifier.windowInsetsEndWidth(WindowInsets.navigationBars)
                            .fillMaxHeight()
                            .align(Alignment.CenterEnd)
                            .background(Color.Red)
                    )
                    // app content
                }
            }
        }
    }
}