Sets the width to that of insets at the endandroidx.compose.ui.Alignment.End of the screen, using either leftWindowInsets.getLeft or rightWindowInsets.getRight, depending on the LayoutDirection.
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
}
}
}
}
}