Loading packages/SystemUI/res/values/dimens.xml +2 −2 Original line number Diff line number Diff line Loading @@ -176,8 +176,8 @@ <!-- Minimum height of a notification to be interactable --> <dimen name="notification_min_interaction_height">40dp</dimen> <!-- New radius for notifications. --> <dimen name="notification_corner_radius">20dp</dimen> <!-- Radius for notifications corners without adjacent notifications --> <dimen name="notification_corner_radius">28dp</dimen> <!-- the padding of the shelf icon container --> <dimen name="shelf_icon_container_padding">13dp</dimen> Loading packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/NotificationRoundnessManager.java +6 −4 Original line number Diff line number Diff line Loading @@ -20,12 +20,9 @@ import android.util.MathUtils; import com.android.systemui.dagger.SysUISingleton; import com.android.systemui.statusbar.notification.NotificationSectionsFeatureManager; import com.android.systemui.statusbar.notification.collection.NotificationEntry; import com.android.systemui.statusbar.notification.row.ExpandableNotificationRow; import com.android.systemui.statusbar.notification.row.ExpandableView; import com.android.systemui.statusbar.phone.KeyguardBypassController; import com.android.systemui.statusbar.policy.HeadsUpManager; import com.android.systemui.statusbar.policy.OnHeadsUpChangedListener; import java.util.HashSet; Loading @@ -48,6 +45,11 @@ public class NotificationRoundnessManager { private ExpandableNotificationRow mTrackedHeadsUp; private float mAppearFraction; // Radius for notification corners WITH adjacent notifications // as percent of radius WITHOUT adjacent notifications. // TODO(b/175710408) pull from dimens and hide from beta builds. static final float SMALL_CORNER_RADIUS = 4f/28; @Inject NotificationRoundnessManager( KeyguardBypassController keyguardBypassController, Loading Loading @@ -126,7 +128,7 @@ public class NotificationRoundnessManager { if (view.showingPulsing() && !mBypassController.getBypassEnabled()) { return 1.0f; } return 0.0f; return SMALL_CORNER_RADIUS; } public void setExpanded(float expandedHeight, float appearFraction) { Loading packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/stack/NotificationRoundnessManagerTest.java +14 −12 Original line number Diff line number Diff line Loading @@ -16,6 +16,8 @@ package com.android.systemui.statusbar.notification.stack; import static com.android.systemui.statusbar.notification.stack.NotificationRoundnessManager.SMALL_CORNER_RADIUS; import static org.mockito.Mockito.atLeast; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.never; Loading Loading @@ -139,7 +141,7 @@ public class NotificationRoundnessManagerTest extends SysuiTestCase { createSection(null, null) }); Assert.assertEquals(1.0f, mSecond.getCurrentBottomRoundness(), 0.0f); Assert.assertEquals(0.0f, mSecond.getCurrentTopRoundness(), 0.0f); Assert.assertEquals(SMALL_CORNER_RADIUS, mSecond.getCurrentTopRoundness(), 0.0f); } @Test Loading @@ -166,8 +168,8 @@ public class NotificationRoundnessManagerTest extends SysuiTestCase { row.setHeadsUp(false); mRoundnessManager.updateView(entry.getRow(), false); Assert.assertEquals(0f, row.getCurrentBottomRoundness(), 0.0f); Assert.assertEquals(0f, row.getCurrentTopRoundness(), 0.0f); Assert.assertEquals(SMALL_CORNER_RADIUS, row.getCurrentBottomRoundness(), 0.0f); Assert.assertEquals(SMALL_CORNER_RADIUS, row.getCurrentTopRoundness(), 0.0f); } @Test Loading @@ -177,7 +179,7 @@ public class NotificationRoundnessManagerTest extends SysuiTestCase { createSection(null, mSecond) }); Assert.assertEquals(1.0f, mSecond.getCurrentBottomRoundness(), 0.0f); Assert.assertEquals(0.0f, mSecond.getCurrentTopRoundness(), 0.0f); Assert.assertEquals(SMALL_CORNER_RADIUS, mSecond.getCurrentTopRoundness(), 0.0f); } @Test Loading @@ -186,7 +188,7 @@ public class NotificationRoundnessManagerTest extends SysuiTestCase { createSection(mFirst, mFirst), createSection(mSecond, null) }); Assert.assertEquals(0.0f, mSecond.getCurrentBottomRoundness(), 0.0f); Assert.assertEquals(SMALL_CORNER_RADIUS, mSecond.getCurrentBottomRoundness(), 0.0f); Assert.assertEquals(1.0f, mSecond.getCurrentTopRoundness(), 0.0f); } Loading @@ -196,7 +198,7 @@ public class NotificationRoundnessManagerTest extends SysuiTestCase { createSection(mFirst, null), createSection(null, null) }); Assert.assertEquals(0.0f, mFirst.getCurrentBottomRoundness(), 0.0f); Assert.assertEquals(SMALL_CORNER_RADIUS, mFirst.getCurrentBottomRoundness(), 0.0f); Assert.assertEquals(1.0f, mFirst.getCurrentTopRoundness(), 0.0f); } Loading @@ -206,8 +208,8 @@ public class NotificationRoundnessManagerTest extends SysuiTestCase { createSection(mSecond, mSecond), createSection(null, null) }); Assert.assertEquals(0.0f, mFirst.getCurrentBottomRoundness(), 0.0f); Assert.assertEquals(0.0f, mFirst.getCurrentTopRoundness(), 0.0f); Assert.assertEquals(SMALL_CORNER_RADIUS, mFirst.getCurrentBottomRoundness(), 0.0f); Assert.assertEquals(SMALL_CORNER_RADIUS, mFirst.getCurrentTopRoundness(), 0.0f); } @Test Loading Loading @@ -253,8 +255,8 @@ public class NotificationRoundnessManagerTest extends SysuiTestCase { createSection(mSecond, mSecond), createSection(null, null) }); Assert.assertEquals(0.0f, mFirst.getCurrentBottomRoundness(), 0.0f); Assert.assertEquals(0.0f, mFirst.getCurrentTopRoundness(), 0.0f); Assert.assertEquals(SMALL_CORNER_RADIUS, mFirst.getCurrentBottomRoundness(), 0.0f); Assert.assertEquals(SMALL_CORNER_RADIUS, mFirst.getCurrentTopRoundness(), 0.0f); } @Test Loading Loading @@ -303,8 +305,8 @@ public class NotificationRoundnessManagerTest extends SysuiTestCase { }); mFirst.setHeadsUpAnimatingAway(true); mFirst.setHeadsUpAnimatingAway(false); Assert.assertEquals(0.0f, mFirst.getCurrentBottomRoundness(), 0.0f); Assert.assertEquals(0.0f, mFirst.getCurrentTopRoundness(), 0.0f); Assert.assertEquals(SMALL_CORNER_RADIUS, mFirst.getCurrentBottomRoundness(), 0.0f); Assert.assertEquals(SMALL_CORNER_RADIUS, mFirst.getCurrentTopRoundness(), 0.0f); } @Test Loading Loading
packages/SystemUI/res/values/dimens.xml +2 −2 Original line number Diff line number Diff line Loading @@ -176,8 +176,8 @@ <!-- Minimum height of a notification to be interactable --> <dimen name="notification_min_interaction_height">40dp</dimen> <!-- New radius for notifications. --> <dimen name="notification_corner_radius">20dp</dimen> <!-- Radius for notifications corners without adjacent notifications --> <dimen name="notification_corner_radius">28dp</dimen> <!-- the padding of the shelf icon container --> <dimen name="shelf_icon_container_padding">13dp</dimen> Loading
packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/NotificationRoundnessManager.java +6 −4 Original line number Diff line number Diff line Loading @@ -20,12 +20,9 @@ import android.util.MathUtils; import com.android.systemui.dagger.SysUISingleton; import com.android.systemui.statusbar.notification.NotificationSectionsFeatureManager; import com.android.systemui.statusbar.notification.collection.NotificationEntry; import com.android.systemui.statusbar.notification.row.ExpandableNotificationRow; import com.android.systemui.statusbar.notification.row.ExpandableView; import com.android.systemui.statusbar.phone.KeyguardBypassController; import com.android.systemui.statusbar.policy.HeadsUpManager; import com.android.systemui.statusbar.policy.OnHeadsUpChangedListener; import java.util.HashSet; Loading @@ -48,6 +45,11 @@ public class NotificationRoundnessManager { private ExpandableNotificationRow mTrackedHeadsUp; private float mAppearFraction; // Radius for notification corners WITH adjacent notifications // as percent of radius WITHOUT adjacent notifications. // TODO(b/175710408) pull from dimens and hide from beta builds. static final float SMALL_CORNER_RADIUS = 4f/28; @Inject NotificationRoundnessManager( KeyguardBypassController keyguardBypassController, Loading Loading @@ -126,7 +128,7 @@ public class NotificationRoundnessManager { if (view.showingPulsing() && !mBypassController.getBypassEnabled()) { return 1.0f; } return 0.0f; return SMALL_CORNER_RADIUS; } public void setExpanded(float expandedHeight, float appearFraction) { Loading
packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/stack/NotificationRoundnessManagerTest.java +14 −12 Original line number Diff line number Diff line Loading @@ -16,6 +16,8 @@ package com.android.systemui.statusbar.notification.stack; import static com.android.systemui.statusbar.notification.stack.NotificationRoundnessManager.SMALL_CORNER_RADIUS; import static org.mockito.Mockito.atLeast; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.never; Loading Loading @@ -139,7 +141,7 @@ public class NotificationRoundnessManagerTest extends SysuiTestCase { createSection(null, null) }); Assert.assertEquals(1.0f, mSecond.getCurrentBottomRoundness(), 0.0f); Assert.assertEquals(0.0f, mSecond.getCurrentTopRoundness(), 0.0f); Assert.assertEquals(SMALL_CORNER_RADIUS, mSecond.getCurrentTopRoundness(), 0.0f); } @Test Loading @@ -166,8 +168,8 @@ public class NotificationRoundnessManagerTest extends SysuiTestCase { row.setHeadsUp(false); mRoundnessManager.updateView(entry.getRow(), false); Assert.assertEquals(0f, row.getCurrentBottomRoundness(), 0.0f); Assert.assertEquals(0f, row.getCurrentTopRoundness(), 0.0f); Assert.assertEquals(SMALL_CORNER_RADIUS, row.getCurrentBottomRoundness(), 0.0f); Assert.assertEquals(SMALL_CORNER_RADIUS, row.getCurrentTopRoundness(), 0.0f); } @Test Loading @@ -177,7 +179,7 @@ public class NotificationRoundnessManagerTest extends SysuiTestCase { createSection(null, mSecond) }); Assert.assertEquals(1.0f, mSecond.getCurrentBottomRoundness(), 0.0f); Assert.assertEquals(0.0f, mSecond.getCurrentTopRoundness(), 0.0f); Assert.assertEquals(SMALL_CORNER_RADIUS, mSecond.getCurrentTopRoundness(), 0.0f); } @Test Loading @@ -186,7 +188,7 @@ public class NotificationRoundnessManagerTest extends SysuiTestCase { createSection(mFirst, mFirst), createSection(mSecond, null) }); Assert.assertEquals(0.0f, mSecond.getCurrentBottomRoundness(), 0.0f); Assert.assertEquals(SMALL_CORNER_RADIUS, mSecond.getCurrentBottomRoundness(), 0.0f); Assert.assertEquals(1.0f, mSecond.getCurrentTopRoundness(), 0.0f); } Loading @@ -196,7 +198,7 @@ public class NotificationRoundnessManagerTest extends SysuiTestCase { createSection(mFirst, null), createSection(null, null) }); Assert.assertEquals(0.0f, mFirst.getCurrentBottomRoundness(), 0.0f); Assert.assertEquals(SMALL_CORNER_RADIUS, mFirst.getCurrentBottomRoundness(), 0.0f); Assert.assertEquals(1.0f, mFirst.getCurrentTopRoundness(), 0.0f); } Loading @@ -206,8 +208,8 @@ public class NotificationRoundnessManagerTest extends SysuiTestCase { createSection(mSecond, mSecond), createSection(null, null) }); Assert.assertEquals(0.0f, mFirst.getCurrentBottomRoundness(), 0.0f); Assert.assertEquals(0.0f, mFirst.getCurrentTopRoundness(), 0.0f); Assert.assertEquals(SMALL_CORNER_RADIUS, mFirst.getCurrentBottomRoundness(), 0.0f); Assert.assertEquals(SMALL_CORNER_RADIUS, mFirst.getCurrentTopRoundness(), 0.0f); } @Test Loading Loading @@ -253,8 +255,8 @@ public class NotificationRoundnessManagerTest extends SysuiTestCase { createSection(mSecond, mSecond), createSection(null, null) }); Assert.assertEquals(0.0f, mFirst.getCurrentBottomRoundness(), 0.0f); Assert.assertEquals(0.0f, mFirst.getCurrentTopRoundness(), 0.0f); Assert.assertEquals(SMALL_CORNER_RADIUS, mFirst.getCurrentBottomRoundness(), 0.0f); Assert.assertEquals(SMALL_CORNER_RADIUS, mFirst.getCurrentTopRoundness(), 0.0f); } @Test Loading Loading @@ -303,8 +305,8 @@ public class NotificationRoundnessManagerTest extends SysuiTestCase { }); mFirst.setHeadsUpAnimatingAway(true); mFirst.setHeadsUpAnimatingAway(false); Assert.assertEquals(0.0f, mFirst.getCurrentBottomRoundness(), 0.0f); Assert.assertEquals(0.0f, mFirst.getCurrentTopRoundness(), 0.0f); Assert.assertEquals(SMALL_CORNER_RADIUS, mFirst.getCurrentBottomRoundness(), 0.0f); Assert.assertEquals(SMALL_CORNER_RADIUS, mFirst.getCurrentTopRoundness(), 0.0f); } @Test Loading