summaryrefslogtreecommitdiffstats
path: root/src/com/android/launcher3/PendingAppWidgetHostView.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/PendingAppWidgetHostView.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/PendingAppWidgetHostView.java')
-rw-r--r--src/com/android/launcher3/PendingAppWidgetHostView.java19
1 files changed, 4 insertions, 15 deletions
diff --git a/src/com/android/launcher3/PendingAppWidgetHostView.java b/src/com/android/launcher3/PendingAppWidgetHostView.java
index 3256df6fe..354cf2065 100644
--- a/src/com/android/launcher3/PendingAppWidgetHostView.java
+++ b/src/com/android/launcher3/PendingAppWidgetHostView.java
@@ -17,7 +17,6 @@
package com.android.launcher3;
import android.content.Context;
-import android.content.res.Resources.Theme;
import android.graphics.Bitmap;
import android.graphics.Canvas;
import android.graphics.Color;
@@ -33,8 +32,8 @@ import android.view.ContextThemeWrapper;
import android.view.View;
import android.view.View.OnClickListener;
-import com.android.launcher3.graphics.DrawableFactory;
import com.android.launcher3.IconCache.ItemInfoUpdateReceiver;
+import com.android.launcher3.graphics.DrawableFactory;
import com.android.launcher3.model.PackageItemInfo;
public class PendingAppWidgetHostView extends LauncherAppWidgetHostView
@@ -42,8 +41,6 @@ public class PendingAppWidgetHostView extends LauncherAppWidgetHostView
private static final float SETUP_ICON_SIZE_FACTOR = 2f / 5;
private static final float MIN_SATUNATION = 0.7f;
- private static Theme sPreloaderTheme;
-
private final Rect mRect = new Rect();
private View mDefaultView;
private OnClickListener mClickListener;
@@ -149,13 +146,8 @@ public class PendingAppWidgetHostView extends LauncherAppWidgetHostView
updateSettingColor();
} else {
- if (sPreloaderTheme == null) {
- sPreloaderTheme = getResources().newTheme();
- sPreloaderTheme.applyStyle(R.style.PreloadIcon, true);
- }
-
- FastBitmapDrawable drawable = drawableFactory.newIcon(mIcon, mInfo);
- mCenterDrawable = new PreloadIconDrawable(drawable, sPreloaderTheme);
+ mCenterDrawable = DrawableFactory.get(getContext())
+ .newPendingIcon(mIcon, getContext());
mCenterDrawable.setCallback(this);
mSettingIconDrawable = null;
applyState();
@@ -226,13 +218,10 @@ public class PendingAppWidgetHostView extends LauncherAppWidgetHostView
int availableHeight = getHeight() - paddingTop - paddingBottom - 2 * minPadding;
if (mSettingIconDrawable == null) {
- int outset = (mCenterDrawable instanceof PreloadIconDrawable) ?
- ((PreloadIconDrawable) mCenterDrawable).getOutset() : 0;
- int maxSize = grid.iconSizePx + 2 * outset;
+ int maxSize = grid.iconSizePx;
int size = Math.min(maxSize, Math.min(availableWidth, availableHeight));
mRect.set(0, 0, size, size);
- mRect.inset(outset, outset);
mRect.offsetTo((getWidth() - mRect.width()) / 2, (getHeight() - mRect.height()) / 2);
mCenterDrawable.setBounds(mRect);
} else {