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
This commit is contained in:
@@ -88,7 +88,7 @@
|
||||
<dimen name="zen_mode_condition_detail_bottom_padding">4dp</dimen>
|
||||
|
||||
<!-- SignalDrawable -->
|
||||
<dimen name="signal_icon_size">17dp</dimen>
|
||||
<dimen name="signal_icon_size">15dp</dimen>
|
||||
<!-- How far to inset the rounded edges -->
|
||||
<dimen name="stat_sys_mobile_signal_circle_inset">0.9dp</dimen>
|
||||
|
||||
|
||||
@@ -14,8 +14,8 @@
|
||||
limitations under the License.
|
||||
-->
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="14dp"
|
||||
android:height="17dp"
|
||||
android:width="12.35dp"
|
||||
android:height="15dp"
|
||||
android:viewportWidth="14"
|
||||
android:viewportHeight="17">
|
||||
|
||||
|
||||
@@ -14,8 +14,8 @@
|
||||
limitations under the License.
|
||||
-->
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="14dp"
|
||||
android:height="17dp"
|
||||
android:width="12.35dp"
|
||||
android:height="15dp"
|
||||
android:viewportWidth="14"
|
||||
android:viewportHeight="17">
|
||||
|
||||
|
||||
@@ -14,8 +14,8 @@
|
||||
limitations under the License.
|
||||
-->
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="14dp"
|
||||
android:height="17dp"
|
||||
android:width="12.35dp"
|
||||
android:height="15dp"
|
||||
android:viewportWidth="14"
|
||||
android:viewportHeight="17">
|
||||
|
||||
|
||||
@@ -14,8 +14,8 @@
|
||||
limitations under the License.
|
||||
-->
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="22dp"
|
||||
android:height="17dp"
|
||||
android:width="19.41dp"
|
||||
android:height="15dp"
|
||||
android:viewportWidth="22"
|
||||
android:viewportHeight="17">
|
||||
|
||||
|
||||
@@ -14,8 +14,8 @@
|
||||
limitations under the License.
|
||||
-->
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="5dp"
|
||||
android:height="17.0dp"
|
||||
android:width="4.44dp"
|
||||
android:height="15.0dp"
|
||||
android:viewportWidth="7.1"
|
||||
android:viewportHeight="24.0">
|
||||
<path
|
||||
|
||||
@@ -14,8 +14,8 @@
|
||||
limitations under the License.
|
||||
-->
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="5dp"
|
||||
android:height="17.0dp"
|
||||
android:width="4.44dp"
|
||||
android:height="15.0dp"
|
||||
android:viewportWidth="7.1"
|
||||
android:viewportHeight="24.0">
|
||||
<path
|
||||
|
||||
@@ -14,8 +14,8 @@
|
||||
limitations under the License.
|
||||
-->
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="6dp"
|
||||
android:height="17dp"
|
||||
android:width="5.29dp"
|
||||
android:height="15dp"
|
||||
android:viewportWidth="6"
|
||||
android:viewportHeight="17">
|
||||
|
||||
|
||||
@@ -14,8 +14,8 @@
|
||||
limitations under the License.
|
||||
-->
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="7dp"
|
||||
android:height="17dp"
|
||||
android:width="6.18dp"
|
||||
android:height="15dp"
|
||||
android:viewportWidth="7"
|
||||
android:viewportHeight="17">
|
||||
|
||||
|
||||
@@ -14,8 +14,8 @@
|
||||
limitations under the License.
|
||||
-->
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="7dp"
|
||||
android:height="17dp"
|
||||
android:width="6.18dp"
|
||||
android:height="15dp"
|
||||
android:viewportWidth="7"
|
||||
android:viewportHeight="17">
|
||||
|
||||
|
||||
@@ -14,8 +14,8 @@
|
||||
limitations under the License.
|
||||
-->
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="15dp"
|
||||
android:height="17dp"
|
||||
android:width="13.24dp"
|
||||
android:height="15dp"
|
||||
android:viewportWidth="15"
|
||||
android:viewportHeight="17">
|
||||
|
||||
|
||||
@@ -14,8 +14,8 @@
|
||||
limitations under the License.
|
||||
-->
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="18dp"
|
||||
android:height="17dp"
|
||||
android:width="15.88dp"
|
||||
android:height="15dp"
|
||||
android:viewportWidth="18"
|
||||
android:viewportHeight="17">
|
||||
|
||||
|
||||
@@ -14,8 +14,8 @@
|
||||
limitations under the License.
|
||||
-->
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="26dp"
|
||||
android:height="17dp"
|
||||
android:width="22.94dp"
|
||||
android:height="15dp"
|
||||
android:viewportWidth="26"
|
||||
android:viewportHeight="17">
|
||||
|
||||
|
||||
@@ -16,8 +16,8 @@
|
||||
-->
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:autoMirrored="true"
|
||||
android:width="18.41dp"
|
||||
android:height="17dp"
|
||||
android:width="16.25dp"
|
||||
android:height="15dp"
|
||||
android:viewportWidth="26.0"
|
||||
android:viewportHeight="24.0">
|
||||
<path
|
||||
|
||||
@@ -16,8 +16,8 @@
|
||||
-->
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:autoMirrored="true"
|
||||
android:width="18.41dp"
|
||||
android:height="17dp"
|
||||
android:width="16.25dp"
|
||||
android:height="15dp"
|
||||
android:viewportWidth="26.0"
|
||||
android:viewportHeight="24.0">
|
||||
<path
|
||||
|
||||
@@ -16,8 +16,8 @@
|
||||
-->
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:autoMirrored="true"
|
||||
android:width="18.41dp"
|
||||
android:height="17dp"
|
||||
android:width="16.25dp"
|
||||
android:height="15dp"
|
||||
android:viewportWidth="26.0"
|
||||
android:viewportHeight="24.0">
|
||||
<path
|
||||
|
||||
@@ -14,8 +14,8 @@
|
||||
limitations under the License.
|
||||
-->
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="18.41dp"
|
||||
android:height="18.41dp"
|
||||
android:width="16.41dp"
|
||||
android:height="16.41dp"
|
||||
android:viewportWidth="21.2"
|
||||
android:viewportHeight="21.2">
|
||||
<group
|
||||
|
||||
@@ -14,8 +14,8 @@ Copyright (C) 2017 The Android Open Source Project
|
||||
limitations under the License.
|
||||
-->
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="18.41dp"
|
||||
android:height="17dp"
|
||||
android:width="16.25dp"
|
||||
android:height="15dp"
|
||||
android:viewportWidth="21.66"
|
||||
android:viewportHeight="20">
|
||||
<group
|
||||
|
||||
@@ -14,8 +14,8 @@
|
||||
limitations under the License.
|
||||
-->
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="18.41dp"
|
||||
android:height="18.41dp"
|
||||
android:width="16.41dp"
|
||||
android:height="16.41dp"
|
||||
android:viewportWidth="21.7"
|
||||
android:viewportHeight="21.7">
|
||||
<group
|
||||
|
||||
@@ -14,8 +14,8 @@ Copyright (C) 2017 The Android Open Source Project
|
||||
limitations under the License.
|
||||
-->
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="18.41dp"
|
||||
android:height="17dp"
|
||||
android:width="16.25dp"
|
||||
android:height="15dp"
|
||||
android:viewportWidth="21.66"
|
||||
android:viewportHeight="20.0">
|
||||
<group
|
||||
|
||||
@@ -14,8 +14,8 @@
|
||||
limitations under the License.
|
||||
-->
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="18.41dp"
|
||||
android:height="18.41dp"
|
||||
android:width="16.41dp"
|
||||
android:height="16.41dp"
|
||||
android:viewportWidth="21.7"
|
||||
android:viewportHeight="21.7">
|
||||
<group
|
||||
|
||||
@@ -14,8 +14,8 @@ Copyright (C) 2017 The Android Open Source Project
|
||||
limitations under the License.
|
||||
-->
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="18.41dp"
|
||||
android:height="17dp"
|
||||
android:width="16.24dp"
|
||||
android:height="15dp"
|
||||
android:viewportWidth="21.86"
|
||||
android:viewportHeight="20.19">
|
||||
<group
|
||||
|
||||
@@ -14,8 +14,8 @@
|
||||
limitations under the License.
|
||||
-->
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="18.41dp"
|
||||
android:height="18.41dp"
|
||||
android:width="16.41dp"
|
||||
android:height="16.41dp"
|
||||
android:viewportWidth="21.7"
|
||||
android:viewportHeight="21.7">
|
||||
<group
|
||||
|
||||
@@ -14,8 +14,8 @@ Copyright (C) 2017 The Android Open Source Project
|
||||
limitations under the License.
|
||||
-->
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="18.41dp"
|
||||
android:height="17dp"
|
||||
android:width="16.27dp"
|
||||
android:height="15dp"
|
||||
android:viewportWidth="21.80"
|
||||
android:viewportHeight="20.1">
|
||||
<group
|
||||
|
||||
@@ -14,8 +14,8 @@
|
||||
limitations under the License.
|
||||
-->
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="18.41dp"
|
||||
android:height="18.41dp"
|
||||
android:width="16.41dp"
|
||||
android:height="16.41dp"
|
||||
android:viewportWidth="21.95"
|
||||
android:viewportHeight="21.65">
|
||||
<group
|
||||
|
||||
@@ -14,8 +14,8 @@ Copyright (C) 2017 The Android Open Source Project
|
||||
limitations under the License.
|
||||
-->
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="18.41dp"
|
||||
android:height="17dp"
|
||||
android:width="16.31dp"
|
||||
android:height="15dp"
|
||||
android:viewportWidth="21.75"
|
||||
android:viewportHeight="20.0">
|
||||
<group
|
||||
|
||||
@@ -14,7 +14,7 @@ Copyright (C) 2014 The Android Open Source Project
|
||||
limitations under the License.
|
||||
-->
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="18.41dp"
|
||||
android:width="16.25dp"
|
||||
android:height="17dp"
|
||||
android:viewportWidth="26.0"
|
||||
android:viewportHeight="24.0">
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
android:layout_width="0dp"
|
||||
android:layout_weight="1"
|
||||
android:layout_height="match_parent"
|
||||
android:paddingEnd="4dp"
|
||||
android:paddingEnd="@dimen/signal_cluster_battery_padding"
|
||||
android:gravity="center_vertical"
|
||||
android:orientation="horizontal"/>
|
||||
|
||||
|
||||
@@ -186,7 +186,7 @@
|
||||
<dimen name="snooze_option_padding">8dp</dimen>
|
||||
|
||||
<!-- size at which Notification icons will be drawn in the status bar -->
|
||||
<dimen name="status_bar_icon_drawing_size">17dp</dimen>
|
||||
<dimen name="status_bar_icon_drawing_size">15dp</dimen>
|
||||
|
||||
<!-- size at which Notification icons will be drawn on Ambient Display -->
|
||||
<dimen name="status_bar_icon_drawing_size_dark">@*android:dimen/notification_header_icon_size_ambient</dimen>
|
||||
|
||||
@@ -141,6 +141,9 @@ public class BatteryMeterView extends LinearLayout implements
|
||||
newUserId);
|
||||
}
|
||||
};
|
||||
|
||||
setClipChildren(false);
|
||||
setClipToPadding(false);
|
||||
}
|
||||
|
||||
public void setForceShowPercent(boolean show) {
|
||||
|
||||
@@ -67,6 +67,12 @@ public class StatusBarIconView extends AnimatedImageView implements StatusIconDi
|
||||
* 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 @@ public class StatusBarIconView extends AnimatedImageView implements StatusIconDi
|
||||
// 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 @@ public class StatusBarIconView extends AnimatedImageView implements StatusIconDi
|
||||
mIconScale = (float)imageBounds / (float)outerBounds;
|
||||
}
|
||||
|
||||
private void updateIconScaleForSystemIcons() {
|
||||
mIconScale = SYSTEM_ICON_SCALE;
|
||||
}
|
||||
|
||||
public float getIconScaleFullyDark() {
|
||||
return (float) mStatusBarIconDrawingSizeDark / mStatusBarIconDrawingSize;
|
||||
}
|
||||
@@ -238,7 +250,7 @@ public class StatusBarIconView extends AnimatedImageView implements StatusIconDi
|
||||
mBlocked = false;
|
||||
mAlwaysScaleIcon = true;
|
||||
reloadDimens();
|
||||
updateIconScale();
|
||||
updateIconScaleForNotifications();
|
||||
mDensity = context.getResources().getDisplayMetrics().densityDpi;
|
||||
}
|
||||
|
||||
@@ -802,7 +814,7 @@ public class StatusBarIconView extends AnimatedImageView implements StatusIconDi
|
||||
public void setDark(boolean dark, boolean fade, long delay) {
|
||||
mDozer.setIntensityDark(f -> {
|
||||
mDarkAmount = f;
|
||||
updateIconScale();
|
||||
updateIconScaleForNotifications();
|
||||
updateDecorColor();
|
||||
updateIconColor();
|
||||
updateAllowAnimation();
|
||||
|
||||
Reference in New Issue
Block a user