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

Commit 3d2b94bf authored by Selim Cinek's avatar Selim Cinek
Browse files

Made notifications below speedbump grey.

Also fixed a small scrimming bug where headsup where
scrimmed.

Bug: 15408642
Change-Id: I8319ccb001a1d654af055276de3c64ae388a7e47
parent 697178b1
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -69,6 +69,9 @@
    <!-- The color of the material notification background when dimmed -->
    <color name="notification_material_background_dimmed_color">#d4ffffff</color>

    <!-- The color of the material notification background when low priority -->
    <color name="notification_material_background_low_priority_color">#ffdcdcdc</color>

    <!-- The color of the ripples on the untinted notifications -->
    <color name="notification_ripple_untinted_color">#20000000</color>

+16 −0
Original line number Diff line number Diff line
@@ -132,6 +132,8 @@ public abstract class ActivatableNotificationView extends ExpandableOutlineView
    private boolean mShowingLegacyBackground;
    private final int mLegacyColor;
    private final int mNormalColor;
    private final int mLowPriorityColor;
    private boolean mIsBelowSpeedBump;

    public ActivatableNotificationView(Context context, AttributeSet attrs) {
        super(context, attrs);
@@ -150,6 +152,8 @@ public abstract class ActivatableNotificationView extends ExpandableOutlineView
                R.dimen.notification_material_rounded_rect_radius);
        mLegacyColor = getResources().getColor(R.color.notification_legacy_background_color);
        mNormalColor = getResources().getColor(R.color.notification_material_background_color);
        mLowPriorityColor = getResources().getColor(
                R.color.notification_material_background_low_priority_color);
    }

    @Override
@@ -162,6 +166,7 @@ public abstract class ActivatableNotificationView extends ExpandableOutlineView
        updateBackground();
        updateBackgroundTint();
        mScrimView = (NotificationScrimView) findViewById(R.id.scrim_view);
        setScrimAmount(0);
    }

    private final Runnable mTapTimeoutRunnable = new Runnable() {
@@ -342,6 +347,15 @@ public abstract class ActivatableNotificationView extends ExpandableOutlineView
        updateBackgroundTint();
    }

    @Override
    public void setBelowSpeedBump(boolean below) {
        super.setBelowSpeedBump(below);
        if (below != mIsBelowSpeedBump) {
            mIsBelowSpeedBump = below;
            updateBackgroundTint();
        }
    }

    /**
     * Sets the tint color of the background
     */
@@ -589,6 +603,8 @@ public abstract class ActivatableNotificationView extends ExpandableOutlineView
            return mBgTint;
        } else if (mShowingLegacyBackground) {
            return mLegacyColor;
        } else if (mIsBelowSpeedBump) {
            return mLowPriorityColor;
        } else {
            return mNormalColor;
        }
+0 −11
Original line number Diff line number Diff line
@@ -1071,7 +1071,6 @@ public abstract class BaseStatusBar extends SystemUI implements
        entry.row = row;
        entry.row.setHeightRange(mRowMinHeight, maxHeight);
        entry.row.setOnActivatedListener(this);
        entry.row.setIsBelowSpeedBump(isBelowSpeedBump(entry.notification));
        entry.expanded = contentViewLocal;
        entry.expandedPublic = publicViewLocal;
        entry.setBigContentView(bigContentViewLocal);
@@ -1548,19 +1547,9 @@ public abstract class BaseStatusBar extends SystemUI implements
        } else {
            entry.row.setOnClickListener(null);
        }
        boolean wasBelow = entry.row.isBelowSpeedBump();
        boolean nowBelow = isBelowSpeedBump(notification);
        if (wasBelow != nowBelow) {
            entry.row.setIsBelowSpeedBump(nowBelow);
        }
        entry.row.notifyContentUpdated();
    }

    private boolean isBelowSpeedBump(StatusBarNotification notification) {
        return notification.getNotification().priority ==
                Notification.PRIORITY_MIN;
    }

    protected void notifyHeadsUpScreenOn(boolean screenOn) {
        if (!screenOn) {
            scheduleHeadsUpEscalation();
+0 −9
Original line number Diff line number Diff line
@@ -52,7 +52,6 @@ public class ExpandableNotificationRow extends ActivatableNotificationView {
    private NotificationContentView mPublicLayout;
    private NotificationContentView mPrivateLayout;
    private int mMaxExpandHeight;
    private boolean mIsBelowSpeedBump;
    private View mVetoButton;

    public ExpandableNotificationRow(Context context, AttributeSet attrs) {
@@ -245,14 +244,6 @@ public class ExpandableNotificationRow extends ActivatableNotificationView {
        mPublicLayout.setClipTopAmount(clipTopAmount);
    }

    public boolean isBelowSpeedBump() {
        return mIsBelowSpeedBump;
    }

    public void setIsBelowSpeedBump(boolean isBelow) {
        this.mIsBelowSpeedBump = isBelow;
    }

    public void notifyContentUpdated() {
        mPublicLayout.notifyContentUpdated();
        mPrivateLayout.notifyContentUpdated();
+3 −0
Original line number Diff line number Diff line
@@ -234,6 +234,9 @@ public abstract class ExpandableView extends FrameLayout {

    public abstract void setScrimAmount(float scrimAmount);

    public void setBelowSpeedBump(boolean below) {
    }

    /**
     * A listener notifying when {@link #getActualHeight} changes.
     */
Loading