summaryrefslogtreecommitdiff
path: root/core/java/android
diff options
context:
space:
mode:
authorTreeHugger Robot <treehugger-gerrit@google.com>2018-12-27 22:37:42 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2018-12-27 22:37:42 +0000
commit2555a5d46f99f5a7889a1be173fe67dd6769e2e7 (patch)
treeeb831a596242fcf8045df29bd0609c1d76e4201e /core/java/android
parent0c1ebffdb3a459dbae549d462b97cdcdc5602816 (diff)
parentc79816b005f351037bdce95a8b803a277fdaf65e (diff)
Merge "Fixes NotificationHeaderView layout."
Diffstat (limited to 'core/java/android')
-rw-r--r--core/java/android/view/NotificationHeaderView.java13
1 files changed, 8 insertions, 5 deletions
diff --git a/core/java/android/view/NotificationHeaderView.java b/core/java/android/view/NotificationHeaderView.java
index 60eeeeaa77ff..f8d5014a29c9 100644
--- a/core/java/android/view/NotificationHeaderView.java
+++ b/core/java/android/view/NotificationHeaderView.java
@@ -195,12 +195,10 @@ public class NotificationHeaderView extends ViewGroup {
}
int childHeight = child.getMeasuredHeight();
MarginLayoutParams params = (MarginLayoutParams) child.getLayoutParams();
- left += params.getMarginStart();
- int right = left + child.getMeasuredWidth();
+ int layoutLeft;
+ int layoutRight;
int top = (int) (getPaddingTop() + (ownHeight - childHeight) / 2.0f);
int bottom = top + childHeight;
- int layoutLeft = left;
- int layoutRight = right;
if ((child == mExpandButton && mShowExpandButtonAtEnd)
|| child == mProfileBadge
|| child == mAppOps) {
@@ -211,6 +209,12 @@ public class NotificationHeaderView extends ViewGroup {
}
layoutLeft = layoutRight - child.getMeasuredWidth();
end = layoutLeft - params.getMarginStart();
+ } else {
+ left += params.getMarginStart();
+ int right = left + child.getMeasuredWidth();
+ layoutLeft = left;
+ layoutRight = right;
+ left = right + params.getMarginEnd();
}
if (getLayoutDirection() == LAYOUT_DIRECTION_RTL) {
int ltrLeft = layoutLeft;
@@ -218,7 +222,6 @@ public class NotificationHeaderView extends ViewGroup {
layoutRight = getWidth() - ltrLeft;
}
child.layout(layoutLeft, top, layoutRight, bottom);
- left = right + params.getMarginEnd();
}
updateTouchListener();
}