From 15ab94530b4c021828cf7e8406a2db88cdac3f84 Mon Sep 17 00:00:00 2001 From: Alex Mang Date: Mon, 1 Jun 2020 13:31:24 -0700 Subject: [PATCH] Align Bubble with Expand Icon Aligns bubble with expand icon and reduces height by 4dp. Updates bubble expansion icons Bug: 155495389 Bug: 155498799 Test: manually on device Change-Id: Iab0ac0fe1f2484d8eb1bb52e668711d65dc71e94 --- .../res/layout/notification_material_action_list.xml | 3 ++- core/res/res/values/dimens.xml | 6 ++++++ core/res/res/values/symbols.xml | 3 +++ packages/SystemUI/res/drawable/ic_create_bubble.xml | 8 ++++---- packages/SystemUI/res/drawable/ic_stop_bubble.xml | 6 +++--- .../notification/row/NotificationContentView.java | 12 +++++++++++- 6 files changed, 29 insertions(+), 9 deletions(-) diff --git a/core/res/res/layout/notification_material_action_list.xml b/core/res/res/layout/notification_material_action_list.xml index ec54091e5a20b..3615b9e2f9cb1 100644 --- a/core/res/res/layout/notification_material_action_list.xml +++ b/core/res/res/layout/notification_material_action_list.xml @@ -22,10 +22,11 @@ android:layout_gravity="bottom"> 8dp + + 3dp + + + 12dp + 6dp diff --git a/core/res/res/values/symbols.xml b/core/res/res/values/symbols.xml index f30d482e06b2a..fa47449e2ca04 100644 --- a/core/res/res/values/symbols.xml +++ b/core/res/res/values/symbols.xml @@ -2766,6 +2766,7 @@ + @@ -3533,6 +3534,8 @@ + + diff --git a/packages/SystemUI/res/drawable/ic_create_bubble.xml b/packages/SystemUI/res/drawable/ic_create_bubble.xml index d58e9a347a2ff..4abbc8179b4da 100644 --- a/packages/SystemUI/res/drawable/ic_create_bubble.xml +++ b/packages/SystemUI/res/drawable/ic_create_bubble.xml @@ -15,11 +15,11 @@ limitations under the License. --> - \ No newline at end of file + android:pathData="M23,5v8h-2V5H3v14h10v2v0H3c-1.1,0 -2,-0.9 -2,-2V5c0,-1.1 0.9,-2 2,-2h18C22.1,3 23,3.9 23,5zM10,8v2.59L5.71,6.29L4.29,7.71L8.59,12H6v2h6V8H10zM19,15c-1.66,0 -3,1.34 -3,3s1.34,3 3,3s3,-1.34 3,-3S20.66,15 19,15z"/> + diff --git a/packages/SystemUI/res/drawable/ic_stop_bubble.xml b/packages/SystemUI/res/drawable/ic_stop_bubble.xml index 11bc741a4f178..6cf67a77ff55b 100644 --- a/packages/SystemUI/res/drawable/ic_stop_bubble.xml +++ b/packages/SystemUI/res/drawable/ic_stop_bubble.xml @@ -15,11 +15,11 @@ limitations under the License. --> + android:pathData="M11.29,14.71L7,10.41V13H5V7h6v2H8.41l4.29,4.29L11.29,14.71zM21,3H3C1.9,3 1,3.9 1,5v14c0,1.1 0.9,2 2,2h10v0v-2H3V5h18v8h2V5C23,3.9 22.1,3 21,3zM19,15c-1.66,0 -3,1.34 -3,3s1.34,3 3,3s3,-1.34 3,-3S20.66,15 19,15z"/> diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/notification/row/NotificationContentView.java b/packages/SystemUI/src/com/android/systemui/statusbar/notification/row/NotificationContentView.java index 9925909c3e16a..9fb60ed4af597 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/notification/row/NotificationContentView.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/notification/row/NotificationContentView.java @@ -1348,7 +1348,9 @@ public class NotificationContentView extends FrameLayout { } ImageView bubbleButton = layout.findViewById(com.android.internal.R.id.bubble_button); View actionContainer = layout.findViewById(com.android.internal.R.id.actions_container); - if (bubbleButton == null || actionContainer == null) { + LinearLayout actionContainerLayout = + layout.findViewById(com.android.internal.R.id.actions_container_layout); + if (bubbleButton == null || actionContainer == null || actionContainerLayout == null) { return; } boolean isPersonWithShortcut = @@ -1374,8 +1376,16 @@ public class NotificationContentView extends FrameLayout { bubbleButton.setOnClickListener(mContainingNotification.getBubbleClickListener()); bubbleButton.setVisibility(VISIBLE); actionContainer.setVisibility(VISIBLE); + + int paddingEnd = getResources().getDimensionPixelSize( + com.android.internal.R.dimen.bubble_visible_padding_end); + actionContainerLayout.setPaddingRelative(0, 0, paddingEnd, 0); } else { bubbleButton.setVisibility(GONE); + + int paddingEnd = getResources().getDimensionPixelSize( + com.android.internal.R.dimen.bubble_gone_padding_end); + actionContainerLayout.setPaddingRelative(0, 0, paddingEnd, 0); } }