5package io.flutter.plugin.platform;
12import android.view.WindowManager;
23 private final Rect viewBounds;
27 private final Rect childRect;
31 viewBounds =
new Rect();
32 childRect =
new Rect();
36 protected void onLayout(
boolean changed,
int l,
int t,
int r,
int b) {
37 for (
int i = 0;
i < getChildCount();
i++) {
38 View child = getChildAt(
i);
39 WindowManager.LayoutParams
params = (WindowManager.LayoutParams) child.getLayoutParams();
40 viewBounds.set(l, t, r,
b);
43 child.getMeasuredWidth(),
44 child.getMeasuredHeight(),
49 child.layout(childRect.left, childRect.top, childRect.right, childRect.bottom);
54 protected void onMeasure(
int widthMeasureSpec,
int heightMeasureSpec) {
55 for (
int i = 0;
i < getChildCount();
i++) {
56 View child = getChildAt(
i);
57 child.measure(atMost(widthMeasureSpec), atMost(heightMeasureSpec));
59 super.onMeasure(widthMeasureSpec, heightMeasureSpec);
62 private static int atMost(
int measureSpec) {
63 return MeasureSpec.makeMeasureSpec(MeasureSpec.getSize(measureSpec), MeasureSpec.AT_MOST);
const EmbeddedViewParams * params