By default in Jetpack Compose a layout children rendering order matches the order of the children in the code. In the following example the ship (Text) will be drawn over the water (Box).
@Composable
fun DrawingOrderExample(submarineMode: Boolean) {
Box(contentAlignment = Alignment.Center) {
Box(
modifier = Modifier
.size(32.dp)
.background(Color.Cyan.copy(alpha = .5f))
)
Text("⛵")
}
}
Can I force the ship to be drawn under the water according to submarineMode argument?

