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

aryk

03/04/2020, 9:18 PM
What's the point of the
indent
parameter? Can't we just add a left offset with padding?
Copy code
@Composable 
fun Divider(
    modifier: Modifier = Modifier.None, 
    color: Color = MaterialTheme.colors().surface, 
    height: Dp = 1.dp, 
    indent: Dp = 0.dp
): Unit
l

Leland Richardson [G]

03/04/2020, 9:41 PM
We actually just discussed this. The indent parameter can be emulated with a
LayoutPadding(left=…)
, but in this case
Divider
is a specific component in the Material spec that is being implemented, where
indent
is specifically a parameter that the spec allows you to change, as such, we consider it as “part of the component itself”. However, we are going to rename it to
startIndent
so that will be a little bit more clear that it is asymmetric
4 Views