diff options
author | Adam Powell <adamp@google.com> | 2011-08-12 14:18:04 -0700 |
---|---|---|
committer | Adam Powell <adamp@google.com> | 2011-08-12 14:21:57 -0700 |
commit | f2b096194483c614b0f427b13412b614ccc40070 (patch) | |
tree | 6431b1bd04d87e33d8911f6e330af98e0871f4c6 | |
parent | 13ed7435030a43c30616a179a3ac2c81d2b297c8 (diff) | |
download | frameworks_base-f2b096194483c614b0f427b13412b614ccc40070.zip frameworks_base-f2b096194483c614b0f427b13412b614ccc40070.tar.gz frameworks_base-f2b096194483c614b0f427b13412b614ccc40070.tar.bz2 |
Fix bug 5095223 - ICS action bar incorrectly resizing app icons
Remove experimental auto-mipmapping of icons.
Change-Id: I326ca396331a050985200b2ecf0d892474262916
-rw-r--r-- | core/java/com/android/internal/widget/ActionBarView.java | 21 |
1 files changed, 1 insertions, 20 deletions
diff --git a/core/java/com/android/internal/widget/ActionBarView.java b/core/java/com/android/internal/widget/ActionBarView.java index a3d0fe4..83f3294 100644 --- a/core/java/com/android/internal/widget/ActionBarView.java +++ b/core/java/com/android/internal/widget/ActionBarView.java @@ -579,7 +579,7 @@ public class ActionBarView extends AbsActionBarView { } public void setIcon(int resId) { - setIcon(mContext.getResources().getDrawableForDensity(resId, getPreferredIconDensity())); + setIcon(mContext.getResources().getDrawable(resId)); } public void setLogo(Drawable logo) { @@ -593,25 +593,6 @@ public class ActionBarView extends AbsActionBarView { setLogo(mContext.getResources().getDrawable(resId)); } - /** - * @return Drawable density to load that will best fit the available height. - */ - private int getPreferredIconDensity() { - final Resources res = mContext.getResources(); - final int availableHeight = getLayoutParams().height - - mHomeLayout.getVerticalIconPadding(); - int iconSize = res.getDimensionPixelSize(android.R.dimen.app_icon_size); - - if (iconSize * DisplayMetrics.DENSITY_LOW >= availableHeight) { - return DisplayMetrics.DENSITY_LOW; - } else if (iconSize * DisplayMetrics.DENSITY_MEDIUM >= availableHeight) { - return DisplayMetrics.DENSITY_MEDIUM; - } else if (iconSize * DisplayMetrics.DENSITY_HIGH >= availableHeight) { - return DisplayMetrics.DENSITY_HIGH; - } - return DisplayMetrics.DENSITY_XHIGH; - } - public void setNavigationMode(int mode) { final int oldMode = mNavigationMode; if (mode != oldMode) { |