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

Marcin Środa

08/11/2020, 9:16 AM
Any updated examples with ConstraintLayout? After update to v16 cannot resolve `tag`:
Copy code
ConstraintSet {
   val image = tag(HEADER_MESSAGE_IMAGE_TAG)
   ...
}
Was looking for some similar id like
layoutId
but cannot see anything
a

allan.conda

08/11/2020, 9:19 AM
Yes, check their source
Copy code
git clone <https://android.googlesource.com/platform/frameworks/support>
I recently migrated my ConstraintLayout as well
👍 1
m

Marcin Środa

08/11/2020, 9:20 AM
thanks
a

allan.conda

08/11/2020, 9:21 AM
but for that snippet it becomes
Copy code
val image = createRefs()
Then with a modifier with something like
Copy code
Image(modifier = Modifier.withConstraint(image) {
    left.constrainTo(parent)
}
it’s much more convenient 😄
alternatively there is also ConstraintSet2 if you still prefer the old pattern
m

Marcin Środa

08/11/2020, 9:23 AM
Yay, finally. Thanks! 🙂
3 Views