Thread
#compose
    Siyamed

    Siyamed

    2 years ago
    it is strange. afaik nothing in text changed to cause a rendering problem. sounds like draw related.not sure where
    s

    semoro

    2 years ago
    Maybe some problems with positioning?
    Aha, got it
    Column {
     Text("Sample")
     Surface(elevation=1.dp) {}
    }
    Seems that it is related to elevation somehow
    Yeah, got another broken screen:
    @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:
    Box {
     Box(Modifier.drawLayer(elevation = 1f))
     Text("Sample", Modifier.drawLayer())
    }
    Didn’t work
    Box {
     Box(Modifier.drawLayer(elevation = 1f))
     Text("Sample")
    }
    Siyamed

    Siyamed

    2 years ago
    I called for help 🙂
    cc @George Mount @Nader Jawad
    Nader Jawad

    Nader Jawad

    2 years ago
    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

    semoro

    2 years ago
    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
    Andrey Kulikov

    Andrey Kulikov

    2 years ago
    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

    semoro

    2 years ago
    Cool! Thank you for workaround