https://kotlinlang.org logo
#compose
Title
# compose
d

Drew Hamilton

12/20/2019, 4:29 PM
I’m struggling to make a “quote indent” component where a bar on the left expands to the full height of X lines of text.
Like Slack’s.
This is what I was expecting to work:
Copy code
Row {
    ColoredRect(
        color = (+MaterialTheme.colors()).onSurface.copy(alpha = 0.12f),
        width = 4.dp
    )
    Space(Width(8.dp))
    Text(toDo.text)
}
But what happens is that the
ColoredRect
expands infinitely in height, pushing any elements below the row out of sight. I’m using it as the
text
element in an
AlertDialog
. What am I doing wrong?
a

Adam Powell

12/20/2019, 4:32 PM
Can you show the code that's calling it?
d

Drew Hamilton

12/20/2019, 6:46 PM
The code calling the
AlertDialog
?
Copy code
@Composable fun Popup(model: Model) {
    val context = +ambient(ContextAmbient)
    AlertDialog(
        ...
        title = { Text("Title") },
        text = <earlier snippet>,
        buttons = ...
That's the function that calls it directly. I can paste where that is called from too if it's relevant. Similar to how Jetnews shows an AlertDialog though