From 1b8840936f90ed48d6c8edcd87fbc4466dc4e5ba Mon Sep 17 00:00:00 2001 From: Winson Chung Date: Fri, 8 Jun 2012 17:13:02 -0700 Subject: Fixing issue where play icon disappears after hitting home (Bug 6636269) Change-Id: I1d1df992495413b3e8962dca8995602ae0aa2ca7 --- src/com/android/launcher2/Launcher.java | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/src/com/android/launcher2/Launcher.java b/src/com/android/launcher2/Launcher.java index 659077f71..9d118e702 100644 --- a/src/com/android/launcher2/Launcher.java +++ b/src/com/android/launcher2/Launcher.java @@ -2867,9 +2867,9 @@ public final class Launcher extends Activity } - private void updateTextButtonWithDrawable(int buttonId, Drawable.ConstantState d) { + private void updateTextButtonWithDrawable(int buttonId, Drawable d) { TextView button = (TextView) findViewById(buttonId); - button.setCompoundDrawables(d.newDrawable(getResources()), null, null, null); + button.setCompoundDrawables(d, null, null, null); } private void updateButtonWithDrawable(int buttonId, Drawable.ConstantState d) { @@ -3021,7 +3021,14 @@ public final class Launcher extends Activity } private void updateAppMarketIcon(Drawable.ConstantState d) { - updateTextButtonWithDrawable(R.id.market_button, d); + // Ensure that the new drawable we are creating has the approprate toolbar icon bounds + Resources r = getResources(); + Drawable marketIconDrawable = d.newDrawable(r); + int w = r.getDimensionPixelSize(R.dimen.toolbar_external_icon_width); + int h = r.getDimensionPixelSize(R.dimen.toolbar_external_icon_height); + marketIconDrawable.setBounds(0, 0, w, h); + + updateTextButtonWithDrawable(R.id.market_button, marketIconDrawable); } @Override -- cgit v1.2.3