ui / winkit.android.ui / android.view.View

Extensions for android.view.View

Name Summary
measure fun View.measure(callback: (width: Int, height: Int) -> Unit): Unit
Calculate the view sizes adding the a ViewTreeObserver.OnGlobalLayoutListener and removing it after the first occurrence.
measureIfNeeded fun View.measureIfNeeded(callback: (width: Int, height: Int) -> Unit): Unit
Call the callback if the view is already measured passing the view’s sizes, otherwise call the measure method.