-
Notifications
You must be signed in to change notification settings - Fork 0
Usage
Yoshida Seisuke edited this page Jan 10, 2018
·
4 revisions
constraintLayout {
backgroundColor = Color.YELLOW
val button1 = button {
id = View.generateViewId()
text = "1"
}
constraints({
parent - button1 - parent
}, {
parent - button1 - parent
})
}
constraintLayout {
backgroundColor = Color.YELLOW
val button1 = button {
id = View.generateViewId()
text = "1"
}.lparams(width = matchConstraint)
constraints({
parent - dip(50) % button1 % dip(50) - parent
}, {
parent - dip(100) % button1
})
}
constraintLayout {
backgroundColor = Color.CYAN
val button1 = button {
id = View.generateViewId()
text = "1"
}
val button2 = button {
id = View.generateViewId()
text = "2"
}
val button3 = button {
id = View.generateViewId()
text = "3"
}
constraints({
parent - chainPacked(button1, button2, button3).alignTail() - parent
}, {
parent - button1 - parent
})
}