summaryrefslogtreecommitdiffstats
path: root/src/com/android/launcher3/badge
diff options
context:
space:
mode:
authorTony Wickham <twickham@google.com>2017-04-27 12:07:34 -0700
committerTony Wickham <twickham@google.com>2017-04-27 14:04:56 -0700
commitf77a6f7fd75243999912d040470a543e825d6d12 (patch)
tree665bc3e93ed490601fa261ac0ba374275d83313d /src/com/android/launcher3/badge
parentead1680e96dea834d3de7be852c2c1a60e046791 (diff)
downloadandroid_packages_apps_Trebuchet-f77a6f7fd75243999912d040470a543e825d6d12.tar.gz
android_packages_apps_Trebuchet-f77a6f7fd75243999912d040470a543e825d6d12.tar.bz2
android_packages_apps_Trebuchet-f77a6f7fd75243999912d040470a543e825d6d12.zip
Re-enable badges, with all dots
Also updated folder badge (dot) color to light gray, added notification header back (with same number as before, where each notification counts as >= 1), and increased shadow opacity for the dots. Change-Id: I53a3e0d94f23f482b55b3c10a922939ebb381314
Diffstat (limited to 'src/com/android/launcher3/badge')
-rw-r--r--src/com/android/launcher3/badge/BadgeRenderer.java8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/com/android/launcher3/badge/BadgeRenderer.java b/src/com/android/launcher3/badge/BadgeRenderer.java
index 2971ceb80..ba1977af4 100644
--- a/src/com/android/launcher3/badge/BadgeRenderer.java
+++ b/src/com/android/launcher3/badge/BadgeRenderer.java
@@ -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.
@@ -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) {
@@ -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;