Marcin Środa

    Marcin Środa

    2 years ago
    Any updated examples with ConstraintLayout? After update to v16 cannot resolve tag:
    ConstraintSet {
       val image = tag(HEADER_MESSAGE_IMAGE_TAG)
       ...
    }
    Was looking for some similar id like
    layoutId
    but cannot see anything
    a

    allan.conda

    2 years ago
    Yes, check their source
    git clone <https://android.googlesource.com/platform/frameworks/support>
    I recently migrated my ConstraintLayout as well
    Marcin Środa

    Marcin Środa

    2 years ago
    thanks
    a

    allan.conda

    2 years ago
    but for that snippet it becomes
    val image = createRefs()
    Then with a modifier with something like
    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
    Marcin Środa

    Marcin Środa

    2 years ago
    Yay, finally. Thanks! 🙂