mirror of
https://github.com/SchildiChat/SchildiChat-android.git
synced 2024-12-27 10:03:06 +01:00
adding docs around the realigning of constraint layout child percentages
This commit is contained in:
parent
468a81e1c3
commit
c45c421e48
@ -31,6 +31,11 @@ fun ConstraintLayout.updateConstraintSet(block: (ConstraintSet) -> Unit) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Helper to recalculate all ConstraintLayout child views with percentage based height against the parent's height.
|
||||||
|
* This is helpful when using a ConstraintLayout within a ScrollView as any percentages will use the total scrolling size
|
||||||
|
* instead of the viewport/ScrollView height
|
||||||
|
*/
|
||||||
fun ConstraintLayout.realignPercentagesToParent() {
|
fun ConstraintLayout.realignPercentagesToParent() {
|
||||||
doOnLayout {
|
doOnLayout {
|
||||||
val rootHeight = (parent as View).height
|
val rootHeight = (parent as View).height
|
||||||
|
Loading…
Reference in New Issue
Block a user