Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 54540975 authored by Mady Mellor's avatar Mady Mellor
Browse files

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
parent ac77186d
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -1973,6 +1973,9 @@ public class ExpandableNotificationRow extends ActivatableNotificationView
        if (mGuts != null) {
            mGuts.setActualHeight(height);
        }
        if (mMenuRow.getMenuView() != null) {
            mMenuRow.onHeightUpdate();
        }
    }

    @Override
+1 −1
Original line number Diff line number Diff line
@@ -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);