Fudge
07/20/2020, 2:58 PMAdam Powell
07/20/2020, 3:10 PMFudge
07/20/2020, 3:10 PMAdam Powell
07/20/2020, 3:12 PMAdam Powell
07/20/2020, 3:14 PMModifier.layout {}
API for defining these quickly without explicitly declaring a LayoutModifier class but it should be coming soonFudge
07/20/2020, 3:14 PMBox(Modifier.width(20.dp)) {
Text("Foo Bar")
}
Are you saying I can achieve this by using some custom layout with Layout()
?Adam Powell
07/20/2020, 3:14 PMAdam Powell
07/20/2020, 3:15 PMFudge
07/20/2020, 3:17 PMFudge
07/20/2020, 3:18 PMokarm
07/20/2020, 3:20 PMFudge
07/20/2020, 3:20 PMFudge
07/20/2020, 3:21 PMokarm
07/20/2020, 3:21 PMAdam Powell
07/20/2020, 3:28 PMAdam Powell
07/20/2020, 3:28 PMAdam Powell
07/20/2020, 3:29 PMFudge
07/20/2020, 3:31 PMmeasure
method decides the constraints that are given to the children? What decides what constraints are given to the parent?Fudge
07/20/2020, 3:32 PMFudge
07/20/2020, 3:39 PMFudge
07/20/2020, 3:54 PMprivate data class CutModifier(
private val maxWidth: Dp
) : LayoutModifier {
override fun MeasureScope.measure(
measurable: Measurable,
constraints: Constraints,
layoutDirection: LayoutDirection
): MeasureScope.MeasureResult {
val placeable = measurable.measure(constraints)
return layout(maxWidth.toIntPx(), placeable.height) {
placeable.place(0, 0)
}
}
}
Is this right? It seems like the modifier is not doing anythingFudge
07/20/2020, 3:55 PMFudge
07/20/2020, 4:11 PMAdam Powell
07/20/2020, 4:21 PMAdam Powell
07/20/2020, 4:22 PM