diff --git a/src/com/android/launcher3/BubbleTextView.java b/src/com/android/launcher3/BubbleTextView.java index f20baea039..5bdc4ed2a7 100644 --- a/src/com/android/launcher3/BubbleTextView.java +++ b/src/com/android/launcher3/BubbleTextView.java @@ -183,6 +183,7 @@ public class BubbleTextView extends TextView implements ItemInfoUpdateReceiver { public void reset() { mBadgeInfo = null; mBadgePalette = null; + mBadgeScale = 0f; mForceHideBadge = false; } diff --git a/src/com/android/launcher3/badge/BadgeRenderer.java b/src/com/android/launcher3/badge/BadgeRenderer.java index c2cc215ce5..6ce334ef35 100644 --- a/src/com/android/launcher3/badge/BadgeRenderer.java +++ b/src/com/android/launcher3/badge/BadgeRenderer.java @@ -26,6 +26,7 @@ import android.graphics.Point; import android.graphics.Rect; import android.graphics.Shader; import android.support.annotation.Nullable; +import android.util.Log; import android.util.SparseArray; import com.android.launcher3.R; @@ -38,6 +39,8 @@ import com.android.launcher3.graphics.ShadowGenerator; */ public class BadgeRenderer { + private static final String TAG = "BadgeRenderer"; + private static final boolean DOTS_ONLY = true; // The badge sizes are defined as percentages of the app icon size. @@ -95,6 +98,10 @@ public class BadgeRenderer { */ public void draw(Canvas canvas, IconPalette palette, @Nullable BadgeInfo badgeInfo, Rect iconBounds, float badgeScale, Point spaceForOffset) { + if (palette == null || iconBounds == null || spaceForOffset == null) { + Log.e(TAG, "Invalid null argument(s) passed in call to draw."); + return; + } mTextPaint.setColor(palette.textColor); IconDrawer iconDrawer = badgeInfo != null && badgeInfo.isIconLarge() ? mLargeIconDrawer : mSmallIconDrawer;