Merge "Update notif corner radii"
This commit is contained in:
committed by
Android (Google) Code Review
commit
199b4799f0
@@ -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>
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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,
|
||||
@@ -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) {
|
||||
|
||||
@@ -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;
|
||||
@@ -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
|
||||
@@ -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
|
||||
@@ -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
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
@@ -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
|
||||
@@ -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
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user