am fab8e550: am db2bfa05: Merge "Fixing issue where play icon disappears after hitting home (Bug 6636269)" into jb-dev
* commit 'fab8e5506ddb26cb8218aa89b60813a8083b9998':
Fixing issue where play icon disappears after hitting home (Bug 6636269)
diff --git a/src/com/android/launcher2/Launcher.java b/src/com/android/launcher2/Launcher.java
index 3641893..b82ee28 100644
--- a/src/com/android/launcher2/Launcher.java
+++ b/src/com/android/launcher2/Launcher.java
@@ -2937,9 +2937,9 @@
}
- 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) {
@@ -3091,7 +3091,14 @@
}
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