it is strange. afaik nothing in text changed to ca...
# compose
s
it is strange. afaik nothing in text changed to cause a rendering problem. sounds like draw related.not sure where
s
Maybe some problems with positioning?
Aha, got it
Copy code
Column {
 Text("Sample")
 Surface(elevation=1.dp) {}
}
Seems that it is related to elevation somehow
Yeah, got another broken screen:
Copy code
@Composable
fun CActivity() {
    Column {
        Text("Sample")
        Button(onClick = {}) {
            Text("Renders properly")
        }
    }
}
Same for
Row
It looks like space is reserved for that text, but text itself doesn’t render
Works:
Copy code
Box {
 Box(Modifier.drawLayer(elevation = 1f))
 Text("Sample", Modifier.drawLayer())
}
Didn’t work
Copy code
Box {
 Box(Modifier.drawLayer(elevation = 1f))
 Text("Sample")
}
s
I called for help 🙂
👍 1
cc @George Mount @Nader Jawad
n
Hi Simon, Looking at your most recent example, is there a reason why the inner box doesn't have a child composable? Is the intention for the Text composable to be a child of the inner Box composable?
s
Nope, I’ve just used it to apply drawLayer/drawShadow to something, it can be effectively replaced by
Surface(elevation=1.dp) {}
Problem occures when there is a Text on same nesting level with something that have elevation
a
yes, unfortunately it is an issue we fixed only after cutting this release as part of this commit: https://android-review.googlesource.com/c/platform/frameworks/support/+/1272904
we reordered drawing so items with lower elevation will be drawn before items with the larger ones and it caused some drawing issues. this will be fixed in dev09. for now you have to use the same elevation for such items or stick to the previous release. I didn't try but as a temporary workaround you can also try: instead of Surface(elevation=1.dp) you can write Surface(Modifier.drawLayer(), elevation=1.dp) it could help here (disable reordering as we introduced another layer with 0 elevation)
s
Cool! Thank you for workaround