When placing 2 or more composables in a Box() in jetpack compose, even if they overlap, they can be focused and clicked through each other, is there a way to prevent this behavior?
Box(
modifier = Modifier.fillMaxSize()
) {
Column(
modifier = Modifier
.fillMaxSize(),
verticalArrangement = Arrangement.Bottom,
horizontalAlignment = Alignment.CenterHorizontally
) {
Button(onClick = { /*TODO*/ }) {
Text(text = "Should NOT be clickable and focusable")
}
}
}
Column(
modifier = Modifier
.fillMaxSize()
.background(
brush = SolidColor(Color.Gray),
alpha = 0.8f
),
verticalArrangement = Arrangement.Top,
horizontalAlignment = Alignment.CenterHorizontally
) {
Button(onClick = { /*TODO*/ }) {
Text(text = "Should be clickable and focusable")
}
}
Expected behavior is when the button on the top is visible, I don't want the button in the top to be clickable And focusable.