summaryrefslogtreecommitdiffstats
path: root/src/com/android/launcher3/BubbleTextView.java
diff options
context:
space:
mode:
authorSunny Goyal <sunnygoyal@google.com>2017-01-03 16:52:43 -0800
committerSunny Goyal <sunnygoyal@google.com>2017-01-05 13:55:35 -0800
commit2d7cca1e052b982a1fd1d28c0174ad4e6f2d22d3 (patch)
tree27d193e94e7850630c91a0acc9ad1fd0644f0dcb /src/com/android/launcher3/BubbleTextView.java
parenta167a6e04bf284d91e98e8dd12706ea8b892bbf3 (diff)
downloadandroid_packages_apps_Trebuchet-2d7cca1e052b982a1fd1d28c0174ad4e6f2d22d3.tar.gz
android_packages_apps_Trebuchet-2d7cca1e052b982a1fd1d28c0174ad4e6f2d22d3.tar.bz2
android_packages_apps_Trebuchet-2d7cca1e052b982a1fd1d28c0174ad4e6f2d22d3.zip
Updating PendingAppWidgetHostView to load icon on the background thread
Bug: 21325319 Change-Id: I0886eec5a3f36f5e1ac18020c54891a56bdb5ed2
Diffstat (limited to 'src/com/android/launcher3/BubbleTextView.java')
-rw-r--r--src/com/android/launcher3/BubbleTextView.java22
1 files changed, 6 insertions, 16 deletions
diff --git a/src/com/android/launcher3/BubbleTextView.java b/src/com/android/launcher3/BubbleTextView.java
index 5e9e7e207..b8b43c9c3 100644
--- a/src/com/android/launcher3/BubbleTextView.java
+++ b/src/com/android/launcher3/BubbleTextView.java
@@ -38,6 +38,7 @@ import android.view.ViewParent;
import android.widget.TextView;
import com.android.launcher3.IconCache.IconLoadRequest;
+import com.android.launcher3.IconCache.ItemInfoUpdateReceiver;
import com.android.launcher3.folder.FolderIcon;
import com.android.launcher3.graphics.DrawableFactory;
import com.android.launcher3.graphics.HolographicOutlineHelper;
@@ -51,7 +52,7 @@ import java.text.NumberFormat;
* too aggressive.
*/
public class BubbleTextView extends TextView
- implements BaseRecyclerViewFastScrollBar.FastScrollFocusableView {
+ implements BaseRecyclerViewFastScrollBar.FastScrollFocusableView, ItemInfoUpdateReceiver {
private static SparseArray<Theme> sPreloaderThemes = new SparseArray<Theme>(2);
@@ -540,7 +541,8 @@ public class BubbleTextView extends TextView
/**
* Applies the item info if it is same as what the view is pointing to currently.
*/
- public void reapplyItemInfo(final ItemInfo info) {
+ @Override
+ public void reapplyItemInfo(ItemInfoWithIcon info) {
if (getTag() == info) {
FastBitmapDrawable.State prevState = FastBitmapDrawable.State.NORMAL;
if (mIcon instanceof FastBitmapDrawable) {
@@ -582,20 +584,8 @@ public class BubbleTextView extends TextView
mIconLoadRequest.cancel();
mIconLoadRequest = null;
}
- if (getTag() instanceof AppInfo) {
- AppInfo info = (AppInfo) getTag();
- if (info.usingLowResIcon) {
- mIconLoadRequest = LauncherAppState.getInstance().getIconCache()
- .updateIconInBackground(BubbleTextView.this, info);
- }
- } else if (getTag() instanceof ShortcutInfo) {
- ShortcutInfo info = (ShortcutInfo) getTag();
- if (info.usingLowResIcon) {
- mIconLoadRequest = LauncherAppState.getInstance().getIconCache()
- .updateIconInBackground(BubbleTextView.this, info);
- }
- } else if (getTag() instanceof PackageItemInfo) {
- PackageItemInfo info = (PackageItemInfo) getTag();
+ if (getTag() instanceof ItemInfoWithIcon) {
+ ItemInfoWithIcon info = (ItemInfoWithIcon) getTag();
if (info.usingLowResIcon) {
mIconLoadRequest = LauncherAppState.getInstance().getIconCache()
.updateIconInBackground(BubbleTextView.this, info);