diff options
author | Sunny Goyal <sunnygoyal@google.com> | 2016-11-12 09:58:29 -0800 |
---|---|---|
committer | Sunny Goyal <sunnygoyal@google.com> | 2016-12-07 15:55:47 -0800 |
commit | 55cb70bf70d6defe84fe44e0d942998adefbb71c (patch) | |
tree | 2b2c1d472153110c3920f99f9493d6deeb19b2d1 /src/com/android/launcher3/PendingAppWidgetHostView.java | |
parent | 4633be64e863a96c63f814a2386b23b02d43910b (diff) | |
download | android_packages_apps_Trebuchet-55cb70bf70d6defe84fe44e0d942998adefbb71c.tar.gz android_packages_apps_Trebuchet-55cb70bf70d6defe84fe44e0d942998adefbb71c.tar.bz2 android_packages_apps_Trebuchet-55cb70bf70d6defe84fe44e0d942998adefbb71c.zip |
Adding an overridable DrawableFactory to allow creating custom icon drawables
> Adding ItemInfo as a parameter for creating drawable
Change-Id: I793acb0381d2b8df4db0a08317dddf1464788ebc
Diffstat (limited to 'src/com/android/launcher3/PendingAppWidgetHostView.java')
-rw-r--r-- | src/com/android/launcher3/PendingAppWidgetHostView.java | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/src/com/android/launcher3/PendingAppWidgetHostView.java b/src/com/android/launcher3/PendingAppWidgetHostView.java index bf397744b..7c9b76bdf 100644 --- a/src/com/android/launcher3/PendingAppWidgetHostView.java +++ b/src/com/android/launcher3/PendingAppWidgetHostView.java @@ -36,6 +36,8 @@ import android.view.ContextThemeWrapper; import android.view.View; import android.view.View.OnClickListener; +import com.android.launcher3.graphics.DrawableFactory; + public class PendingAppWidgetHostView extends LauncherAppWidgetHostView implements OnClickListener { private static final float SETUP_ICON_SIZE_FACTOR = 2f / 5; private static final float MIN_SATUNATION = 0.7f; @@ -132,13 +134,14 @@ public class PendingAppWidgetHostView extends LauncherAppWidgetHostView implemen // 1) App icon in the center // 2) Preload icon in the center // 3) Setup icon in the center and app icon in the top right corner. + DrawableFactory drawableFactory = DrawableFactory.get(getContext()); if (mDisabledForSafeMode) { - FastBitmapDrawable disabledIcon = mLauncher.createIconDrawable(mIcon); + FastBitmapDrawable disabledIcon = drawableFactory.newIcon(mIcon, mInfo); disabledIcon.setIsDisabled(true); mCenterDrawable = disabledIcon; mSettingIconDrawable = null; } else if (isReadyForClickSetup()) { - mCenterDrawable = new FastBitmapDrawable(mIcon); + mCenterDrawable = drawableFactory.newIcon(mIcon, mInfo); mSettingIconDrawable = getResources().getDrawable(R.drawable.ic_setting).mutate(); updateSettingColor(); @@ -148,7 +151,7 @@ public class PendingAppWidgetHostView extends LauncherAppWidgetHostView implemen sPreloaderTheme.applyStyle(R.style.PreloadIcon, true); } - FastBitmapDrawable drawable = mLauncher.createIconDrawable(mIcon); + FastBitmapDrawable drawable = drawableFactory.newIcon(mIcon, mInfo); mCenterDrawable = new PreloadIconDrawable(drawable, sPreloaderTheme); mCenterDrawable.setCallback(this); mSettingIconDrawable = null; |