From 54540975a51c5433b4c77447acf1f6cb2b1e3562 Mon Sep 17 00:00:00 2001 From: Mady Mellor Date: Wed, 7 Jun 2017 11:55:36 -0700 Subject: Update alignment for gear / snooze icons to shift when expanded MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit How do the icons get placed? - Ideally they are centered in the “normal” notification height - If the notification is larger than that, they remain in the same place - If the notification is smaller than that they are centered in the remaining space - If the height changes while showing, they shift Test: manual - have min notification, show gear / snooze, expand it note that the gear / snooze icons shift when expanded. Also tested on variety of sized notifications (big picture, custom view + groups) Fixes: 37922756 Change-Id: I6a2d8cd9e76e5a816adf79d052c4e15cf855886b --- .../src/com/android/systemui/statusbar/ExpandableNotificationRow.java | 3 +++ .../src/com/android/systemui/statusbar/NotificationMenuRow.java | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/ExpandableNotificationRow.java b/packages/SystemUI/src/com/android/systemui/statusbar/ExpandableNotificationRow.java index ed4f6855c515..22c0b736b007 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/ExpandableNotificationRow.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/ExpandableNotificationRow.java @@ -1973,6 +1973,9 @@ public class ExpandableNotificationRow extends ActivatableNotificationView if (mGuts != null) { mGuts.setActualHeight(height); } + if (mMenuRow.getMenuView() != null) { + mMenuRow.onHeightUpdate(); + } } @Override diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/NotificationMenuRow.java b/packages/SystemUI/src/com/android/systemui/statusbar/NotificationMenuRow.java index f8591247f1d0..533cf89875b9 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/NotificationMenuRow.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/NotificationMenuRow.java @@ -420,7 +420,7 @@ public class NotificationMenuRow implements NotificationMenuRowPlugin, View.OnCl if (mParent == null || mMenuItems.size() == 0 || mMenuContainer == null) { return; } - int parentHeight = mParent.getCollapsedHeight(); + int parentHeight = mParent.getActualHeight(); float translationY; if (parentHeight < mVertSpaceForIcons) { translationY = (parentHeight / 2) - (mHorizSpaceForIcon / 2); -- cgit v1.2.3-59-g8ed1b