From 55cb70bf70d6defe84fe44e0d942998adefbb71c Mon Sep 17 00:00:00 2001 From: Sunny Goyal Date: Sat, 12 Nov 2016 09:58:29 -0800 Subject: Adding an overridable DrawableFactory to allow creating custom icon drawables > Adding ItemInfo as a parameter for creating drawable Change-Id: I793acb0381d2b8df4db0a08317dddf1464788ebc --- src/com/android/launcher3/Hotseat.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/com/android/launcher3/Hotseat.java') diff --git a/src/com/android/launcher3/Hotseat.java b/src/com/android/launcher3/Hotseat.java index b93c6dfa1..5c96dde43 100644 --- a/src/com/android/launcher3/Hotseat.java +++ b/src/com/android/launcher3/Hotseat.java @@ -129,14 +129,15 @@ public class Hotseat extends FrameLayout if (!FeatureFlags.NO_ALL_APPS_ICON) { // Add the Apps button Context context = getContext(); - int allAppsButtonRank = mLauncher.getDeviceProfile().inv.getAllAppsButtonRank(); + DeviceProfile grid = mLauncher.getDeviceProfile(); + int allAppsButtonRank = grid.inv.getAllAppsButtonRank(); LayoutInflater inflater = LayoutInflater.from(context); TextView allAppsButton = (TextView) inflater.inflate(R.layout.all_apps_button, mContent, false); Drawable d = context.getResources().getDrawable(R.drawable.all_apps_button_icon); + d.setBounds(0, 0, grid.iconSizePx, grid.iconSizePx); - mLauncher.resizeIconDrawable(d); int scaleDownPx = getResources().getDimensionPixelSize(R.dimen.all_apps_button_scale_down); Rect bounds = d.getBounds(); d.setBounds(bounds.left, bounds.top + scaleDownPx / 2, bounds.right - scaleDownPx, -- cgit v1.2.3