Update alignment for gear / snooze icons to shift when expanded

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
This commit is contained in:
Mady Mellor
2017-06-07 11:55:36 -07:00
parent ac77186d34
commit 54540975a5
2 changed files with 4 additions and 1 deletions

View File

@@ -1973,6 +1973,9 @@ public class ExpandableNotificationRow extends ActivatableNotificationView
if (mGuts != null) {
mGuts.setActualHeight(height);
}
if (mMenuRow.getMenuView() != null) {
mMenuRow.onHeightUpdate();
}
}
@Override

View File

@@ -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);