Status bar icons 15 dp
Shrink all status bar icons by 2dp. This means setting a scale factor on
anything that is a StatusBarIconView, and manually scaling down wifi and
mobile data groups.
Also fix the padding between the mobile data view and the battery
Also snuck in a fix for the battery saver icon clipping on QS
Change-Id: I5f5430d9e9c66f5c2794dcf4974cf18aa3bff061
Test: visual
Fixes: 74985733
Fixes: 79967193
Bug: 77822905
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/StatusBarIconView.java b/packages/SystemUI/src/com/android/systemui/statusbar/StatusBarIconView.java
index 4fc18ad..8d2c934 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/StatusBarIconView.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/StatusBarIconView.java
@@ -67,6 +67,12 @@
* everything above 30% to 50%, making it appear on 1bit color depths.
*/
private static final float DARK_ALPHA_BOOST = 0.67f;
+ /**
+ * Status icons are currently drawn with the intention of being 17dp tall, but we
+ * want to scale them (in a way that doesn't require an asset dump) down 2dp. So
+ * 17dp * (15 / 17) = 15dp, the new height.
+ */
+ private static final float SYSTEM_ICON_SCALE = 15.f / 17.f;
private final int ANIMATION_DURATION_FAST = 100;
public static final int STATE_ICON = 0;
@@ -178,11 +184,13 @@
// We do not resize and scale system icons (on the right), only notification icons (on the
// left).
if (mNotification != null || mAlwaysScaleIcon) {
- updateIconScale();
+ updateIconScaleForNotifications();
+ } else {
+ updateIconScaleForSystemIcons();
}
}
- private void updateIconScale() {
+ private void updateIconScaleForNotifications() {
final float imageBounds = NotificationUtils.interpolate(
mStatusBarIconDrawingSize,
mStatusBarIconDrawingSizeDark,
@@ -191,6 +199,10 @@
mIconScale = (float)imageBounds / (float)outerBounds;
}
+ private void updateIconScaleForSystemIcons() {
+ mIconScale = SYSTEM_ICON_SCALE;
+ }
+
public float getIconScaleFullyDark() {
return (float) mStatusBarIconDrawingSizeDark / mStatusBarIconDrawingSize;
}
@@ -238,7 +250,7 @@
mBlocked = false;
mAlwaysScaleIcon = true;
reloadDimens();
- updateIconScale();
+ updateIconScaleForNotifications();
mDensity = context.getResources().getDisplayMetrics().densityDpi;
}
@@ -802,7 +814,7 @@
public void setDark(boolean dark, boolean fade, long delay) {
mDozer.setIntensityDark(f -> {
mDarkAmount = f;
- updateIconScale();
+ updateIconScaleForNotifications();
updateDecorColor();
updateIconColor();
updateAllowAnimation();