summaryrefslogtreecommitdiffstats
path: root/src/com/android/launcher3/BubbleTextView.java
diff options
context:
space:
mode:
authorSunny Goyal <sunnygoyal@google.com>2017-02-02 16:37:21 -0800
committerSunny Goyal <sunnygoyal@google.com>2017-02-06 10:43:27 -0800
commit96ac68a481ce5b794b5227e09ace7c30d6dd5e7b (patch)
tree9ea46cdeccfce02fbe0830d7430f9f95c64557b6 /src/com/android/launcher3/BubbleTextView.java
parente1fa0145d36fbefeb397f952cba2689ce537d786 (diff)
downloadandroid_packages_apps_Trebuchet-96ac68a481ce5b794b5227e09ace7c30d6dd5e7b.tar.gz
android_packages_apps_Trebuchet-96ac68a481ce5b794b5227e09ace7c30d6dd5e7b.tar.bz2
android_packages_apps_Trebuchet-96ac68a481ce5b794b5227e09ace7c30d6dd5e7b.zip
Updating the PreloadIconDrawable
> The drawable gets the path from MaskIconDrawable path, instead of using a circle > The progress changes are animated as well Bug: 34831873 Change-Id: I4e7f0b610f4fd94de8e0cfcf8b179b775cf0b4d8
Diffstat (limited to 'src/com/android/launcher3/BubbleTextView.java')
-rw-r--r--src/com/android/launcher3/BubbleTextView.java26
1 files changed, 3 insertions, 23 deletions
diff --git a/src/com/android/launcher3/BubbleTextView.java b/src/com/android/launcher3/BubbleTextView.java
index 2efe31fa0..8043eacdb 100644
--- a/src/com/android/launcher3/BubbleTextView.java
+++ b/src/com/android/launcher3/BubbleTextView.java
@@ -19,7 +19,6 @@ package com.android.launcher3;
import android.content.Context;
import android.content.res.ColorStateList;
import android.content.res.Resources;
-import android.content.res.Resources.Theme;
import android.content.res.TypedArray;
import android.graphics.Bitmap;
import android.graphics.Canvas;
@@ -27,7 +26,6 @@ import android.graphics.Paint;
import android.graphics.Region;
import android.graphics.drawable.Drawable;
import android.util.AttributeSet;
-import android.util.SparseArray;
import android.util.TypedValue;
import android.view.KeyEvent;
import android.view.MotionEvent;
@@ -45,6 +43,7 @@ import com.android.launcher3.folder.FolderIcon;
import com.android.launcher3.graphics.DrawableFactory;
import com.android.launcher3.graphics.HolographicOutlineHelper;
import com.android.launcher3.graphics.IconPalette;
+import com.android.launcher3.graphics.PreloadIconDrawable;
import com.android.launcher3.model.PackageItemInfo;
import java.text.NumberFormat;
@@ -57,8 +56,6 @@ import java.text.NumberFormat;
public class BubbleTextView extends TextView
implements BaseRecyclerViewFastScrollBar.FastScrollFocusableView, ItemInfoUpdateReceiver {
- private static SparseArray<Theme> sPreloaderThemes = new SparseArray<Theme>(2);
-
// Dimensions in DP
private static final float AMBIENT_SHADOW_RADIUS = 2.5f;
private static final float KEY_SHADOW_RADIUS = 1f;
@@ -423,10 +420,6 @@ public class BubbleTextView extends TextView
super.onAttachedToWindow();
if (mBackground != null) mBackground.setCallback(this);
-
- if (mIcon instanceof PreloadIconDrawable) {
- ((PreloadIconDrawable) mIcon).applyPreloaderTheme(getPreloaderTheme());
- }
mSlop = ViewConfiguration.get(getContext()).getScaledTouchSlop();
}
@@ -495,7 +488,8 @@ public class BubbleTextView extends TextView
if (mIcon instanceof PreloadIconDrawable) {
preloadDrawable = (PreloadIconDrawable) mIcon;
} else {
- preloadDrawable = new PreloadIconDrawable(mIcon, getPreloaderTheme());
+ preloadDrawable = DrawableFactory.get(getContext())
+ .newPendingIcon(info.iconBitmap, getContext());
setIcon(preloadDrawable);
}
@@ -520,20 +514,6 @@ public class BubbleTextView extends TextView
: null;
}
- private Theme getPreloaderTheme() {
- Object tag = getTag();
- int style = ((tag != null) && (tag instanceof ShortcutInfo) &&
- (((ShortcutInfo) tag).container >= 0)) ? R.style.PreloadIcon_Folder
- : R.style.PreloadIcon;
- Theme theme = sPreloaderThemes.get(style);
- if (theme == null) {
- theme = getResources().newTheme();
- theme.applyStyle(style, true);
- sPreloaderThemes.put(style, theme);
- }
- return theme;
- }
-
/**
* Sets the icon for this view based on the layout direction.
*/