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

Commit b8e214f7 authored by Anthony Chen's avatar Anthony Chen Committed by Android (Google) Code Review
Browse files

Merge "Allow clipping of notifications to be toggled."

parents cfd5ce40 9fe1ee74
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -50,6 +50,7 @@

        <com.android.systemui.statusbar.stack.NotificationStackScrollLayout
            android:id="@+id/notification_stack_scroller"
            android:layout_marginTop="@dimen/notification_panel_margin_top"
            android:layout_width="@dimen/notification_panel_width"
            android:layout_height="match_parent"
            android:layout_gravity="@integer/notification_panel_layout_gravity"
+9 −0
Original line number Diff line number Diff line
@@ -359,4 +359,13 @@
    <!-- Whether or not to show the expand button at the end of the notification header. -->
    <bool name="config_showNotificationExpandButtonAtEnd">false</bool>

    <!-- Whether or the notifications should be clipped to be reduced in height if it has been
         scrolled to the top of the screen. -->
    <bool name="config_clipNotificationScrollToTop">true</bool>

    <!-- Whether or not the notification contents should be clipped to any background that is
         set on the notification container. For example, if this value is true and the background
         has rounded corners, then the contents will be clipped to those corners. -->
    <bool name="config_clipNotificationsToOutline">false</bool>

</resources>
+10 −0
Original line number Diff line number Diff line
@@ -200,6 +200,13 @@
    <!-- Width for the notification panel and related windows -->
    <dimen name="match_parent">-1px</dimen>
    <dimen name="standard_notification_panel_width">416dp</dimen>

    <!-- The top margin of the panel that holds the list of notifications. -->
    <dimen name="notification_panel_margin_top">0dp</dimen>

    <!-- The bottom margin of the panel that holds the list of notifications. -->
    <dimen name="notification_panel_margin_bottom">0dp</dimen>

    <dimen name="notification_panel_width">@dimen/match_parent</dimen>

    <dimen name="volume_dialog_panel_width">@dimen/standard_notification_panel_width</dimen>
@@ -320,6 +327,9 @@
    <!-- The height of the divider between the individual notifications. -->
    <dimen name="notification_divider_height">0.5dp</dimen>

    <!-- The corner radius of the shadow behind the notification. -->
    <dimen name="notification_shadow_radius">0dp</dimen>

    <!-- The height of a notification header -->
    <dimen name="notification_header_height">53dp</dimen>

+2 −0
Original line number Diff line number Diff line
@@ -798,7 +798,9 @@ public class ExpandableNotificationRow extends ActivatableNotificationView
        return mMenuRow;
    }

    @Override
    public void onDensityOrFontScaleChanged() {
        super.onDensityOrFontScaleChanged();
        initDimens();
        if (mIsSummaryWithChildren) {
            if (mChildrenContainer != null) {
+18 −5
Original line number Diff line number Diff line
@@ -34,6 +34,7 @@ public abstract class ExpandableOutlineView extends ExpandableView {
    private final Rect mOutlineRect = new Rect();
    private boolean mCustomOutline;
    private float mOutlineAlpha = -1f;
    private float mOutlineRadius;

    /**
     * {@code true} if the children views of the {@link ExpandableOutlineView} are translated when
@@ -46,12 +47,13 @@ public abstract class ExpandableOutlineView extends ExpandableView {
        public void getOutline(View view, Outline outline) {
            int translation = mShouldTranslateContents ? 0 : (int) getTranslation();
            if (!mCustomOutline) {
                outline.setRect(translation,
                outline.setRoundRect(translation,
                        mClipTopAmount,
                        getWidth() + translation,
                        Math.max(getActualHeight() - mClipBottomAmount, mClipTopAmount));
                        Math.max(getActualHeight() - mClipBottomAmount, mClipTopAmount),
                        mOutlineRadius);
            } else {
                outline.setRect(mOutlineRect);
                outline.setRoundRect(mOutlineRect, mOutlineRadius);
            }
            outline.setAlpha(mOutlineAlpha);
        }
@@ -60,9 +62,20 @@ public abstract class ExpandableOutlineView extends ExpandableView {
    public ExpandableOutlineView(Context context, AttributeSet attrs) {
        super(context, attrs);
        setOutlineProvider(mProvider);
        initDimens();
    }

    private void initDimens() {
        Resources res = getResources();
        mShouldTranslateContents =
                res.getBoolean(R.bool.config_translateNotificationContentsOnSwipe);
        mOutlineRadius = res.getDimension(R.dimen.notification_shadow_radius);
        setClipToOutline(res.getBoolean(R.bool.config_clipNotificationsToOutline));
    }

    public void onDensityOrFontScaleChanged() {
        initDimens();
        invalidateOutline();
    }

    @Override
@@ -119,8 +132,8 @@ public abstract class ExpandableOutlineView extends ExpandableView {
    }

    /**
     * @return whether the view currently needs an outline. This is usually false in case it doesn't
     * have a background.
     * @return Whether the view currently needs an outline. This is usually {@code false} in case
     * it doesn't have a background.
     */
    protected boolean needsOutline() {
        if (isChildInGroup()) {
Loading