Sheroz Nazhmudinov
09/04/2020, 6:25 PMimplementation "androidx.compose.ui:ui:$compose_version"
implementation "androidx.compose.material:material:$compose_version"
implementation "androidx.ui:ui-tooling:$compose_version"
implementation "androidx.compose.foundation:foundation:$compose_version"
implementation "androidx.compose.ui:ui:$compose_version"
And here’s the basic attempt on using ConstraintLayout:
@Composable
@Preview
fun PreviewGreeting() {
ConstraintLayout(constraintSet = ConstraintSet {
tag("someTag")
}) {
Greeting(greeting = "Hello world")
}
}
I get the error thou saying unresolved reference tag. can smbd please tell me which dependency am I missing?romainguy
09/04/2020, 6:28 PMSheroz Nazhmudinov
09/04/2020, 6:28 PM1.0.0-alpha02
romainguy
09/04/2020, 6:28 PMConstraintLayout(modifier = Modifier.padding(12.dp).fillMaxWidth()) {
val (decreaseRef, increaseRef, labelRef, colorRef, amountRef) = createRefs()
SmallButton(
modifier = Modifier.constrainAs(decreaseRef) {
start.linkTo(parent.start)
centerVerticallyTo(parent)
},
onClick = { decrease(product) }
) {
Image(Icons.Sharp.Remove)
}
// ...
}
Sheroz Nazhmudinov
09/04/2020, 6:29 PMromainguy
09/04/2020, 6:29 PMcreateRef()
and createRefs()
nickbutcher
09/04/2020, 6:36 PMSheroz Nazhmudinov
09/04/2020, 6:37 PM