summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Matt Casey <mrcasey@google.com> 2022-06-01 19:03:44 +0000
committer Android (Google) Code Review <android-gerrit@google.com> 2022-06-01 19:03:44 +0000
commita834a9bd52bc60f0aa054aa4a8847a545ddefe15 (patch)
tree9034bd97a5e0553d95ead2403a88715640fe4ed0
parentbd35c8dabfe4bda5594de50966485598f69181e3 (diff)
parentc91318ace9919f51ad91861178e593f5bbb39a0f (diff)
Merge "Fix ResolverDrawerLayout child measurement" into tm-dev
-rw-r--r--core/java/com/android/internal/widget/ResolverDrawerLayout.java8
1 files changed, 4 insertions, 4 deletions
diff --git a/core/java/com/android/internal/widget/ResolverDrawerLayout.java b/core/java/com/android/internal/widget/ResolverDrawerLayout.java
index 90eeabb47e9a..1cdc10866f2c 100644
--- a/core/java/com/android/internal/widget/ResolverDrawerLayout.java
+++ b/core/java/com/android/internal/widget/ResolverDrawerLayout.java
@@ -929,7 +929,7 @@ public class ResolverDrawerLayout extends ViewGroup {
// Single-use layout; just ignore the mode and use available space.
// Clamp to maxWidth.
if (mMaxWidth >= 0) {
- widthSize = Math.min(widthSize, mMaxWidth);
+ widthSize = Math.min(widthSize, mMaxWidth + getPaddingLeft() + getPaddingRight());
}
final int widthSpec = MeasureSpec.makeMeasureSpec(widthSize, MeasureSpec.EXACTLY);
@@ -1008,8 +1008,9 @@ public class ResolverDrawerLayout extends ViewGroup {
View indicatorHost = null;
int ypos = mTopOffset;
- int leftEdge = getPaddingLeft();
- int rightEdge = width - getPaddingRight();
+ final int leftEdge = getPaddingLeft();
+ final int rightEdge = width - getPaddingRight();
+ final int widthAvailable = rightEdge - leftEdge;
final int childCount = getChildCount();
for (int i = 0; i < childCount; i++) {
@@ -1030,7 +1031,6 @@ public class ResolverDrawerLayout extends ViewGroup {
final int bottom = top + child.getMeasuredHeight();
final int childWidth = child.getMeasuredWidth();
- final int widthAvailable = rightEdge - leftEdge;
final int left = leftEdge + (widthAvailable - childWidth) / 2;
final int right = left + childWidth;