Alexandru Gheorghe
08/08/2024, 9:12 AMModifier.fillMaxSize()
and figured out how to always display the CPI in the foreground? When I'm doing this, with a few TextFields composed, the CPI shows behind TextField composables. I noticed that apps usually have a white background overlayed on top of composables with the CPI overlayed on top of the white (transparent) background. Or something similar. How to achieve this in Jetpack Compose?Stylianos Gakis
08/08/2024, 10:07 AMBox() {
CircularProgressIndicator()
OtherContent()
}
Do
Box() {
OtherContent()
CircularProgressIndicator()
}
And then CircularProgressIndicator()
will render on top of everything else.Alexandru Gheorghe
08/08/2024, 10:53 AMBox {
CircularProgressIndicator()
}
Composables here for the UI
Alexandru Gheorghe
08/08/2024, 10:53 AMAlexandru Caraus
08/08/2024, 11:28 AMAlexandru Caraus
08/08/2024, 11:30 AMBox {
Behind1()
InFrontOfBehind1()
InFrontOfInFrontOfBehind1()
}
Alexandru Caraus
08/08/2024, 11:31 AMAlexandru Gheorghe
08/08/2024, 11:55 AMStylianos Gakis
08/08/2024, 11:56 AMBox() {
OtherContent()
}
CircularProgressIndicator()
Stylianos Gakis
08/08/2024, 12:00 PMsetContent {
Box() {
OtherContent()
}
CircularProgressIndicator()
}
You do get an implicit "box-like" behavior at the top level.
It's then up to you to decide if you want to depend on this implicitness or actually decide where your composables will render.
And having said all this, the order of drawing the composables is still in the order they are declared in the code, top to bottom, provided you are never editing any Z axis anywhere.