mirror of
https://github.com/SchildiChat/SchildiChat-android.git
synced 2025-03-18 20:29:10 +03:00
adding docs around the realigning of constraint layout child percentages
This commit is contained in:
parent
468a81e1c3
commit
c45c421e48
1 changed files with 5 additions and 0 deletions
|
@ -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() {
|
||||
doOnLayout {
|
||||
val rootHeight = (parent as View).height
|
||||
|
|
Loading…
Add table
Reference in a new issue