Loading res/values-v26/bools.xml +1 −1 Original line number Diff line number Diff line Loading @@ -17,7 +17,7 @@ --> <resources> <bool name="notification_badging_enabled">false</bool> <bool name="notification_badging_enabled">true</bool> <bool name="enable_install_shortcut_api">false</bool> </resources> No newline at end of file src/com/android/launcher3/badge/BadgeRenderer.java +5 −3 Original line number Diff line number Diff line Loading @@ -38,6 +38,8 @@ import com.android.launcher3.graphics.ShadowGenerator; */ public class BadgeRenderer { private static final boolean DOTS_ONLY = true; // The badge sizes are defined as percentages of the app icon size. private static final float SIZE_PERCENTAGE = 0.38f; // Used to expand the width of the badge for each additional digit. Loading Loading @@ -101,7 +103,7 @@ public class BadgeRenderer { String notificationCount = badgeInfo == null ? "0" : String.valueOf(badgeInfo.getNotificationCount()); int numChars = notificationCount.length(); int width = mSize + mCharSize * (numChars - 1); int width = DOTS_ONLY ? mSize : mSize + mCharSize * (numChars - 1); // Lazily load the background with shadow. Bitmap backgroundWithShadow = mBackgroundsWithShadow.get(numChars); if (backgroundWithShadow == null) { Loading @@ -112,8 +114,8 @@ public class BadgeRenderer { // We draw the badge relative to its center. int badgeCenterX = iconBounds.right - width / 2; int badgeCenterY = iconBounds.top + mSize / 2; boolean isText = badgeInfo != null && badgeInfo.getNotificationCount() != 0; boolean isIcon = icon != null; boolean isText = !DOTS_ONLY && badgeInfo != null && badgeInfo.getNotificationCount() != 0; boolean isIcon = !DOTS_ONLY && icon != null; boolean isDot = !(isText || isIcon); if (isDot) { badgeScale *= DOT_SCALE; Loading src/com/android/launcher3/graphics/IconPalette.java +1 −1 Original line number Diff line number Diff line Loading @@ -35,7 +35,7 @@ public class IconPalette { private static final boolean DEBUG = false; private static final String TAG = "IconPalette"; public static final IconPalette FOLDER_ICON_PALETTE = new IconPalette(Color.WHITE); public static final IconPalette FOLDER_ICON_PALETTE = new IconPalette(Color.parseColor("#BDC1C6")); private static final float MIN_PRELOAD_COLOR_SATURATION = 0.2f; private static final float MIN_PRELOAD_COLOR_LIGHTNESS = 0.6f; Loading src/com/android/launcher3/graphics/ShadowGenerator.java +2 −4 Original line number Diff line number Diff line Loading @@ -87,8 +87,6 @@ public class ShadowGenerator { float shadowRadius = height * 1f / 32; float shadowYOffset = height * 1f / 16; int ambientShadowAlpha = AMBIENT_SHADOW_ALPHA / 2; int keyShadowAlpha = KEY_SHADOW_ALPHA / 2; int radius = height / 2; Loading @@ -109,11 +107,11 @@ public class ShadowGenerator { int bottom = center + height / 2; // Draw ambient shadow, center aligned within size blurPaint.setAlpha(ambientShadowAlpha); blurPaint.setAlpha(AMBIENT_SHADOW_ALPHA); canvas.drawRoundRect(left, top, right, bottom, radius, radius, blurPaint); // Draw key shadow, bottom aligned within size blurPaint.setAlpha(keyShadowAlpha); blurPaint.setAlpha(KEY_SHADOW_ALPHA); canvas.drawRoundRect(left, top + shadowYOffset, right, bottom + shadowYOffset, radius, radius, blurPaint); Loading src/com/android/launcher3/notification/NotificationKeyData.java +1 −1 Original line number Diff line number Diff line Loading @@ -37,7 +37,7 @@ public class NotificationKeyData { private NotificationKeyData(String notificationKey, String shortcutId, int count) { this.notificationKey = notificationKey; this.shortcutId = shortcutId; this.count = count; this.count = Math.max(1, count); } public static NotificationKeyData fromNotification(StatusBarNotification sbn) { Loading Loading
res/values-v26/bools.xml +1 −1 Original line number Diff line number Diff line Loading @@ -17,7 +17,7 @@ --> <resources> <bool name="notification_badging_enabled">false</bool> <bool name="notification_badging_enabled">true</bool> <bool name="enable_install_shortcut_api">false</bool> </resources> No newline at end of file
src/com/android/launcher3/badge/BadgeRenderer.java +5 −3 Original line number Diff line number Diff line Loading @@ -38,6 +38,8 @@ import com.android.launcher3.graphics.ShadowGenerator; */ public class BadgeRenderer { private static final boolean DOTS_ONLY = true; // The badge sizes are defined as percentages of the app icon size. private static final float SIZE_PERCENTAGE = 0.38f; // Used to expand the width of the badge for each additional digit. Loading Loading @@ -101,7 +103,7 @@ public class BadgeRenderer { String notificationCount = badgeInfo == null ? "0" : String.valueOf(badgeInfo.getNotificationCount()); int numChars = notificationCount.length(); int width = mSize + mCharSize * (numChars - 1); int width = DOTS_ONLY ? mSize : mSize + mCharSize * (numChars - 1); // Lazily load the background with shadow. Bitmap backgroundWithShadow = mBackgroundsWithShadow.get(numChars); if (backgroundWithShadow == null) { Loading @@ -112,8 +114,8 @@ public class BadgeRenderer { // We draw the badge relative to its center. int badgeCenterX = iconBounds.right - width / 2; int badgeCenterY = iconBounds.top + mSize / 2; boolean isText = badgeInfo != null && badgeInfo.getNotificationCount() != 0; boolean isIcon = icon != null; boolean isText = !DOTS_ONLY && badgeInfo != null && badgeInfo.getNotificationCount() != 0; boolean isIcon = !DOTS_ONLY && icon != null; boolean isDot = !(isText || isIcon); if (isDot) { badgeScale *= DOT_SCALE; Loading
src/com/android/launcher3/graphics/IconPalette.java +1 −1 Original line number Diff line number Diff line Loading @@ -35,7 +35,7 @@ public class IconPalette { private static final boolean DEBUG = false; private static final String TAG = "IconPalette"; public static final IconPalette FOLDER_ICON_PALETTE = new IconPalette(Color.WHITE); public static final IconPalette FOLDER_ICON_PALETTE = new IconPalette(Color.parseColor("#BDC1C6")); private static final float MIN_PRELOAD_COLOR_SATURATION = 0.2f; private static final float MIN_PRELOAD_COLOR_LIGHTNESS = 0.6f; Loading
src/com/android/launcher3/graphics/ShadowGenerator.java +2 −4 Original line number Diff line number Diff line Loading @@ -87,8 +87,6 @@ public class ShadowGenerator { float shadowRadius = height * 1f / 32; float shadowYOffset = height * 1f / 16; int ambientShadowAlpha = AMBIENT_SHADOW_ALPHA / 2; int keyShadowAlpha = KEY_SHADOW_ALPHA / 2; int radius = height / 2; Loading @@ -109,11 +107,11 @@ public class ShadowGenerator { int bottom = center + height / 2; // Draw ambient shadow, center aligned within size blurPaint.setAlpha(ambientShadowAlpha); blurPaint.setAlpha(AMBIENT_SHADOW_ALPHA); canvas.drawRoundRect(left, top, right, bottom, radius, radius, blurPaint); // Draw key shadow, bottom aligned within size blurPaint.setAlpha(keyShadowAlpha); blurPaint.setAlpha(KEY_SHADOW_ALPHA); canvas.drawRoundRect(left, top + shadowYOffset, right, bottom + shadowYOffset, radius, radius, blurPaint); Loading
src/com/android/launcher3/notification/NotificationKeyData.java +1 −1 Original line number Diff line number Diff line Loading @@ -37,7 +37,7 @@ public class NotificationKeyData { private NotificationKeyData(String notificationKey, String shortcutId, int count) { this.notificationKey = notificationKey; this.shortcutId = shortcutId; this.count = count; this.count = Math.max(1, count); } public static NotificationKeyData fromNotification(StatusBarNotification sbn) { Loading