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

Commit f7829f92 authored by Clark Scheff's avatar Clark Scheff Committed by Steve Kondik
Browse files

Themes: Use rounded rect for heads up notification

This uses the same value that is used for rounding the corner
of the notification's shadow.

Change-Id: I62bd26c9a4bd90aa29a66ee07f67065a63721e97
parent adffd732
Loading
Loading
Loading
Loading
+7 −2
Original line number Original line Diff line number Diff line
@@ -75,6 +75,8 @@ public class HeadsUpNotificationView extends FrameLayout implements SwipeHelper.
    private int mUser;
    private int mUser;
    private String mMostRecentPackageName;
    private String mMostRecentPackageName;


    private static int sRoundedRectCornerRadius = 0;

    public HeadsUpNotificationView(Context context, AttributeSet attrs) {
    public HeadsUpNotificationView(Context context, AttributeSet attrs) {
        this(context, attrs, 0);
        this(context, attrs, 0);
    }
    }
@@ -87,6 +89,8 @@ public class HeadsUpNotificationView extends FrameLayout implements SwipeHelper.
        mSnoozedPackages = new ArrayMap<>();
        mSnoozedPackages = new ArrayMap<>();
        mDefaultSnoozeLengthMs = resources.getInteger(R.integer.heads_up_default_snooze_length_ms);
        mDefaultSnoozeLengthMs = resources.getInteger(R.integer.heads_up_default_snooze_length_ms);
        mSnoozeLengthMs = mDefaultSnoozeLengthMs;
        mSnoozeLengthMs = mDefaultSnoozeLengthMs;
        sRoundedRectCornerRadius = context.getResources().getDimensionPixelSize(
                R.dimen.notification_material_rounded_rect_radius);
    }
    }


    public void updateResources() {
    public void updateResources() {
@@ -234,9 +238,10 @@ public class HeadsUpNotificationView extends FrameLayout implements SwipeHelper.
            int outlineTop = view.getPaddingTop();
            int outlineTop = view.getPaddingTop();


            // Apply padding to shadow.
            // Apply padding to shadow.
            outline.setRect(outlineLeft, outlineTop,
            outline.setRoundRect(outlineLeft, outlineTop,
                    view.getWidth() - outlineLeft - view.getPaddingRight(),
                    view.getWidth() - outlineLeft - view.getPaddingRight(),
                    view.getHeight() - outlineTop - view.getPaddingBottom());
                    view.getHeight() - outlineTop - view.getPaddingBottom(),
                    sRoundedRectCornerRadius);
        }
        }
    };
    };