MCPcopy Create free account
hub / github.com/Snapchat/Valdi / measureAndLayout

Method measureAndLayout

valdi/src/java/com/snap/valdi/ViewRef.kt:95–109  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

93 doInvalidateLayout(view)
94 }
95
96 private fun measureAndLayout(view: View, x: Int, y: Int, width: Int, height: Int, animating: Boolean) {
97 ViewUtils.setCalculatedFrame(view, x, y, width, height)
98
99 if (animating || view.parent == null) {
100 val widthMeasureSpec = View.MeasureSpec.makeMeasureSpec(width, View.MeasureSpec.EXACTLY)
101 val heightMeasureSpec = View.MeasureSpec.makeMeasureSpec(height, View.MeasureSpec.EXACTLY)
102
103 view.measure(widthMeasureSpec, heightMeasureSpec)
104 view.layout(x, y, width + x, height + y)
105
106 ViewUtils.notifyDidApplyLayout(view)
107 } else {
108 view.requestLayout()
109 }
110 }
111
112 fun onFrameChanged(x: Int, y: Int, width: Int, height: Int, isRightToLeft: Boolean, animator: Any?) {

Callers

nothing calls this directly

Calls 6

setCalculatedFrameMethod · 0.80
makeMeasureSpecMethod · 0.80
notifyDidApplyLayoutMethod · 0.80
measureMethod · 0.65
layoutMethod · 0.65
requestLayoutMethod · 0.45

Tested by

no test coverage detected