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

Commit 1e9d3043 authored by Lyn Han's avatar Lyn Han
Browse files

Encapsulate background width updates to ActivatableNotificationView

Bug: 213480466
Test: normal short shelf usage => no regressions
Change-Id: If14da43648663f425ed2ce417d9b3d376980a473
parent 45b079a3
Loading
Loading
Loading
Loading
+1 −4
Original line number Diff line number Diff line
@@ -226,10 +226,7 @@ public class NotificationShelf extends ActivatableNotificationView implements
                ? MathUtils.lerp(shortestWidth, getWidth(), fractionToShade)
                : getWidth();
        ActivatableNotificationView anv = (ActivatableNotificationView) this;
        NotificationBackgroundView bg = anv.getBackgroundNormal();
        if (bg != null) {
            anv.getBackgroundNormal().setActualWidth((int) actualWidth);
        }
        anv.setBackgroundWidth((int) actualWidth);
        if (mShelfIcons != null) {
            mShelfIcons.setActualLayoutWidth((int) actualWidth);
        }
+6 −3
Original line number Diff line number Diff line
@@ -163,10 +163,13 @@ public abstract class ActivatableNotificationView extends ExpandableOutlineView
    }

    /**
     * @return The background of this view.
     * @param width The actual width to apply to the background view.
     */
    public NotificationBackgroundView getBackgroundNormal() {
        return mBackgroundNormal;
    public void setBackgroundWidth(int width) {
        if (mBackgroundNormal == null) {
            return;
        }
        mBackgroundNormal.setActualWidth(width);
    }

    @Override