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

Arun

11/05/2020, 2:29 PM
Hi, there's a
Divider
composable for horizontal dividers. Will there be a counterpart for vertical?
j

Javier

11/05/2020, 2:35 PM
Same
Divider
should work too
a

Arun

11/05/2020, 2:37 PM
The source
Copy code
@Composable
fun Divider(
    modifier: Modifier = Modifier,
    color: Color = MaterialTheme.colors.onSurface.copy(alpha = DividerAlpha),
    thickness: Dp = 1.dp,
    startIndent: Dp = 0.dp
) {
    val indentMod = if (startIndent.value != 0f) {
        Modifier.padding(start = startIndent)
    } else {
        Modifier
    }
    Box(
        modifier.then(indentMod)
            .fillMaxWidth()
            .preferredHeight(thickness)
            .background(color = color)
    )
}
looks like it's only applicable for horizontal dividers. Will check for vertical. I'm fairly new to able to judge from source code though
j

Javier

11/05/2020, 4:28 PM
4 Views