From 96ac68a481ce5b794b5227e09ace7c30d6dd5e7b Mon Sep 17 00:00:00 2001 From: Sunny Goyal Date: Thu, 2 Feb 2017 16:37:21 -0800 Subject: 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 --- src/com/android/launcher3/BubbleTextView.java | 26 +++----------------------- 1 file changed, 3 insertions(+), 23 deletions(-) (limited to 'src/com/android/launcher3/BubbleTextView.java') 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 sPreloaderThemes = new SparseArray(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. */ -- cgit v1.2.3