Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file modified packages/core/platforms/android/widgets-release.aar
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,29 @@ protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
int measureWidth = 0;
int measureHeight = 0;

int paddingLeft = this.getPaddingLeft();
int paddingRight = this.getPaddingRight();
int paddingTop = this.getPaddingTop();
int paddingBottom = this.getPaddingBottom();

// Our own padding is not available to children: reduce the spec we pass down,
// mirroring StackLayout/DockLayout. Without this, a child measured against the
// full parent size can be laid out larger than the padding box it actually gets,
// silently losing content to clipChildren (e.g. Android edge-to-edge insets
// applied as padding on an ancestor).
int widthMode = MeasureSpec.getMode(widthMeasureSpec);
int childWidthMeasureSpec = widthMode == MeasureSpec.UNSPECIFIED ? widthMeasureSpec : MeasureSpec.makeMeasureSpec(Math.max(0, MeasureSpec.getSize(widthMeasureSpec) - paddingLeft - paddingRight), widthMode);

int heightMode = MeasureSpec.getMode(heightMeasureSpec);
int childHeightMeasureSpec = heightMode == MeasureSpec.UNSPECIFIED ? heightMeasureSpec : MeasureSpec.makeMeasureSpec(Math.max(0, MeasureSpec.getSize(heightMeasureSpec) - paddingTop - paddingBottom), heightMode);

for (int i = 0, count = this.getChildCount(); i < count; i++) {
View child = this.getChildAt(i);
if (child.getVisibility() == View.GONE) {
continue;
}

CommonLayoutParams.measureChild(child, widthMeasureSpec, heightMeasureSpec);
CommonLayoutParams.measureChild(child, childWidthMeasureSpec, childHeightMeasureSpec);
final int childMeasuredWidth = CommonLayoutParams.getDesiredWidth(child);
final int childMeasuredHeight = CommonLayoutParams.getDesiredHeight(child);

Expand All @@ -45,8 +61,8 @@ protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
}

// Add in our padding
measureWidth += this.getPaddingLeft() + this.getPaddingRight();
measureHeight += this.getPaddingTop() + this.getPaddingBottom();
measureWidth += paddingLeft + paddingRight;
measureHeight += paddingTop + paddingBottom;

// Check against our minimum sizes
measureWidth = Math.max(measureWidth, this.getSuggestedMinimumWidth());
Expand All @@ -69,7 +85,7 @@ protected void onLayout(boolean changed, int left, int top, int right, int botto
int childTop = paddingTop;

int childRight = right - left - (paddingLeft + paddingRight);
int childBottom = bottom - top - (paddingRight + paddingBottom);
int childBottom = bottom - top - paddingBottom;

for (int i = 0, count = this.getChildCount(); i < count; i++) {
View child = this.getChildAt(i);
Expand Down
4 changes: 2 additions & 2 deletions packages/ui-mobile-base/native-build-state.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"artifactHash": "sha256:71ac91f0e4290e8a38d253649a73cdeef87e5bfa10e013ead5f61eecd57aff70"
},
"android": {
"sourceHash": "sha256:a90aaa2d98aa88ef7410cc875dc26b19fc3d6402f57c94c76e892e828dfe951b",
"artifactHash": "sha256:19c79bb864e7ac4888d09dd92650c87ff214da98d19c8ee58e77e2dec228809e"
"sourceHash": "sha256:4cad084e6839acb2bfb66a4d3b1dceeb2951c4df5f8699ea70f3cd2fe84add77",
"artifactHash": "sha256:c849a02ac33117f78d74d0886aaf07ab17d097ba1ee97b697d59348dbc415c1f"
}
}
Loading