diff options
author | Tony Wickham <twickham@google.com> | 2017-01-18 22:36:17 +0000 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2017-01-18 22:36:17 +0000 |
commit | 197f97bde4368e79b9475749560ab668a29fc552 (patch) | |
tree | 46f25194582af6706b9bcc509f0bcd8c97292e92 /src/com/android/launcher3/BubbleTextView.java | |
parent | 8e98cb876f1c913c256ce6d542a1f975f59f1e2e (diff) | |
parent | 9a8d11f930ced4c2706db150b7bbbb21330bd68d (diff) | |
download | android_packages_apps_Trebuchet-197f97bde4368e79b9475749560ab668a29fc552.tar.gz android_packages_apps_Trebuchet-197f97bde4368e79b9475749560ab668a29fc552.tar.bz2 android_packages_apps_Trebuchet-197f97bde4368e79b9475749560ab668a29fc552.zip |
Merge "FastBitmapDrawable can draw an icon badge (notification count)" into ub-launcher3-master
Diffstat (limited to 'src/com/android/launcher3/BubbleTextView.java')
-rw-r--r-- | src/com/android/launcher3/BubbleTextView.java | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/src/com/android/launcher3/BubbleTextView.java b/src/com/android/launcher3/BubbleTextView.java index 32c3ac8be..d9e9c7bb0 100644 --- a/src/com/android/launcher3/BubbleTextView.java +++ b/src/com/android/launcher3/BubbleTextView.java @@ -39,6 +39,8 @@ import android.widget.TextView; import com.android.launcher3.IconCache.IconLoadRequest; import com.android.launcher3.IconCache.ItemInfoUpdateReceiver; +import com.android.launcher3.badge.BadgeRenderer; +import com.android.launcher3.badge.BadgeInfo; import com.android.launcher3.folder.FolderIcon; import com.android.launcher3.graphics.DrawableFactory; import com.android.launcher3.graphics.HolographicOutlineHelper; @@ -164,7 +166,7 @@ public class BubbleTextView extends TextView applyIconAndLabel(info.iconBitmap, info); setTag(info); if (promiseStateChanged || info.isPromise()) { - applyState(promiseStateChanged); + applyPromiseState(promiseStateChanged); } } @@ -470,7 +472,7 @@ public class BubbleTextView extends TextView mLongPressHelper.cancelLongPress(); } - public void applyState(boolean promiseStateChanged) { + public void applyPromiseState(boolean promiseStateChanged) { if (getTag() instanceof ShortcutInfo) { ShortcutInfo info = (ShortcutInfo) getTag(); final boolean isPromise = info.isPromise(); @@ -479,8 +481,8 @@ public class BubbleTextView extends TextView info.getInstallProgress() : 0)) : 100; setContentDescription(progressLevel > 0 ? - getContext().getString(R.string.app_downloading_title, info.title, - NumberFormat.getPercentInstance().format(progressLevel * 0.01)) : + getContext().getString(R.string.app_downloading_title, info.title, + NumberFormat.getPercentInstance().format(progressLevel * 0.01)) : getContext().getString(R.string.app_waiting_download_title, info.title)); if (mIcon != null) { @@ -500,6 +502,13 @@ public class BubbleTextView extends TextView } } + public void applyBadgeState(BadgeInfo badgeInfo) { + if (mIcon instanceof FastBitmapDrawable) { + BadgeRenderer badgeRenderer = mLauncher.getDeviceProfile().mBadgeRenderer; + ((FastBitmapDrawable) mIcon).applyIconBadge(badgeInfo, badgeRenderer); + } + } + private Theme getPreloaderTheme() { Object tag = getTag(); int style = ((tag != null) && (tag instanceof ShortcutInfo) && |