Skip to content

Instantly share code, notes, and snippets.

@TimCastelijns
Created February 4, 2019 17:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save TimCastelijns/c3a94966d928a1bfdf2bbd99ac8c01b9 to your computer and use it in GitHub Desktop.
Save TimCastelijns/c3a94966d928a1bfdf2bbd99ac8c01b9 to your computer and use it in GitHub Desktop.
// Devices
private val uiView: View = LayoutInflater.from(container.context).inflate(R.layout.devices, container, true)
// Menu
private val uiView: View = LayoutInflater.from(container.context).inflate(R.layout.menu, container, true)
// Constraints
private fun layoutUiComponents(rootContainer: ConstraintLayout) {
val constraintSet = ConstraintSet()
constraintSet.clone(rootContainer)
// Devices
constraintSet.connect(
devicesComponent.getContainerId(),
ConstraintSet.TOP,
ConstraintSet.PARENT_ID,
ConstraintSet.TOP
)
// Menu
constraintSet.connect(
menuComponent.getContainerId(),
ConstraintSet.TOP,
devicesComponent.getContainerId(),
ConstraintSet.BOTTOM
)
constraintSet.connect(
menuComponent.getContainerId(),
ConstraintSet.BOTTOM,
ConstraintSet.PARENT_ID,
ConstraintSet.BOTTOM
)
constraintSet.applyTo(rootContainer)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment