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

Commit 679bbd51 authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Enable flag to hide half-swipe shelf"

parents 5f5fdaea 453744d1
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -295,7 +295,7 @@ public class NotificationMenuRow implements NotificationMenuRowPlugin, View.OnCl
            mMenuContainer = new FrameLayout(mContext);
        }
        final boolean newFlowHideShelf = Settings.Global.getInt(mContext.getContentResolver(),
                Settings.Global.SHOW_NEW_NOTIF_DISMISS, 0) == 1;
                Settings.Global.SHOW_NEW_NOTIF_DISMISS, 1 /* on by default */) == 1;
        if (newFlowHideShelf) {
            return;
        }
+3 −3
Original line number Diff line number Diff line
@@ -834,9 +834,9 @@ public class NotificationStackScrollLayout extends ViewGroup implements Dumpable
        if (!mShouldDrawNotificationBackground) {
            return;
        }
        final boolean clearUndershelf = Settings.Global.getInt(mContext.getContentResolver(),
                Settings.Global.SHOW_NEW_NOTIF_DISMISS, 0 /* show background by default */) == 1;
        if (clearUndershelf) {
        final boolean newFlowHideShelf = Settings.Global.getInt(mContext.getContentResolver(),
                Settings.Global.SHOW_NEW_NOTIF_DISMISS, 1 /* on by default */) == 1;
        if (newFlowHideShelf) {
            mBackgroundPaint.setColor(Color.TRANSPARENT);
            invalidate();
            return;
+17 −0
Original line number Diff line number Diff line
@@ -15,6 +15,7 @@
package com.android.systemui.statusbar.notification.row;

import static android.provider.Settings.Secure.SHOW_NOTIFICATION_SNOOZE;
import static android.provider.Settings.Global.SHOW_NEW_NOTIF_DISMISS;

import static junit.framework.Assert.assertEquals;
import static junit.framework.Assert.assertFalse;
@@ -96,6 +97,7 @@ public class NotificationMenuRowTest extends LeakCheckedTest {
    @Test
    public void testNoAppOpsInSlowSwipe() {
        Settings.Secure.putInt(mContext.getContentResolver(), SHOW_NOTIFICATION_SNOOZE, 0);
        Settings.Global.putInt(mContext.getContentResolver(), SHOW_NEW_NOTIF_DISMISS, 0);

        NotificationMenuRow row = new NotificationMenuRow(mContext, mPeopleNotificationIdentifier);
        row.createMenu(mRow, null);
@@ -108,6 +110,7 @@ public class NotificationMenuRowTest extends LeakCheckedTest {
    @Test
    public void testNoSnoozeInSlowSwipe() {
        Settings.Secure.putInt(mContext.getContentResolver(), SHOW_NOTIFICATION_SNOOZE, 0);
        Settings.Global.putInt(mContext.getContentResolver(), SHOW_NEW_NOTIF_DISMISS, 0);

        NotificationMenuRow row = new NotificationMenuRow(mContext, mPeopleNotificationIdentifier);
        row.createMenu(mRow, null);
@@ -120,6 +123,7 @@ public class NotificationMenuRowTest extends LeakCheckedTest {
    @Test
    public void testSnoozeInSlowSwipe() {
        Settings.Secure.putInt(mContext.getContentResolver(), SHOW_NOTIFICATION_SNOOZE, 1);
        Settings.Global.putInt(mContext.getContentResolver(), SHOW_NEW_NOTIF_DISMISS, 0);

        NotificationMenuRow row = new NotificationMenuRow(mContext, mPeopleNotificationIdentifier);
        row.createMenu(mRow, null);
@@ -129,6 +133,19 @@ public class NotificationMenuRowTest extends LeakCheckedTest {
        assertEquals(2, container.getChildCount());
    }

    @Test
    public void testSlowSwipe_newDismiss() {
        Settings.Secure.putInt(mContext.getContentResolver(), SHOW_NOTIFICATION_SNOOZE, 1);
        Settings.Global.putInt(mContext.getContentResolver(), SHOW_NEW_NOTIF_DISMISS, 1);

        NotificationMenuRow row = new NotificationMenuRow(mContext, mPeopleNotificationIdentifier);
        row.createMenu(mRow, null);

        ViewGroup container = (ViewGroup) row.getMenuView();
        // Clear menu
        assertEquals(0, container.getChildCount());
    }

    @Test
    public void testIsSnappedAndOnSameSide() {
        NotificationMenuRow row = Mockito.spy(