Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
ConstraintSetExtension
fun ConstraintSet.setCardElevation(cardView: CardView, elevation: Float) {
getConstraint(cardView.id)?.let {
it.mCustomConstraints["CardElevation"] = ConstraintAttribute(
"CardElevation",
ConstraintAttribute.AttributeType.DIMENSION_TYPE,
elevation
)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment