summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--core/java/android/view/NotificationHeaderView.java24
-rw-r--r--core/res/res/layout/notification_template_header.xml1
2 files changed, 10 insertions, 15 deletions
diff --git a/core/java/android/view/NotificationHeaderView.java b/core/java/android/view/NotificationHeaderView.java
index ada78532d63f..60eeeeaa77ff 100644
--- a/core/java/android/view/NotificationHeaderView.java
+++ b/core/java/android/view/NotificationHeaderView.java
@@ -201,22 +201,16 @@ public class NotificationHeaderView extends ViewGroup {
int bottom = top + childHeight;
int layoutLeft = left;
int layoutRight = right;
- if (child == mExpandButton && mShowExpandButtonAtEnd) {
- layoutRight = end - mContentEndMargin;
- end = layoutLeft = layoutRight - child.getMeasuredWidth();
- }
- if (child == mProfileBadge) {
- int paddingEnd = getPaddingEnd();
- if (mShowWorkBadgeAtEnd) {
- paddingEnd = mContentEndMargin;
+ if ((child == mExpandButton && mShowExpandButtonAtEnd)
+ || child == mProfileBadge
+ || child == mAppOps) {
+ if (end == getMeasuredWidth()) {
+ layoutRight = end - mContentEndMargin;
+ } else {
+ layoutRight = end - params.getMarginEnd();
}
- layoutRight = end - paddingEnd;
- end = layoutLeft = layoutRight - child.getMeasuredWidth();
- }
- if (child == mAppOps) {
- int paddingEnd = mContentEndMargin;
- layoutRight = end - paddingEnd;
- end = layoutLeft = layoutRight - child.getMeasuredWidth();
+ layoutLeft = layoutRight - child.getMeasuredWidth();
+ end = layoutLeft - params.getMarginStart();
}
if (getLayoutDirection() == LAYOUT_DIRECTION_RTL) {
int ltrLeft = layoutLeft;
diff --git a/core/res/res/layout/notification_template_header.xml b/core/res/res/layout/notification_template_header.xml
index 5ba1cf259551..0f53549a966c 100644
--- a/core/res/res/layout/notification_template_header.xml
+++ b/core/res/res/layout/notification_template_header.xml
@@ -111,6 +111,7 @@
android:background="@null"
android:layout_width="@dimen/notification_header_expand_icon_size"
android:layout_height="@dimen/notification_header_expand_icon_size"
+ android:layout_marginStart="4dp"
android:paddingTop="@dimen/notification_expand_button_padding_top"
android:visibility="gone"
android:contentDescription="@string/expand_button_content_description_collapsed"