diff options
author | Patrick Dubroy <dubroy@google.com> | 2010-11-01 15:16:13 -0700 |
---|---|---|
committer | Patrick Dubroy <dubroy@google.com> | 2010-11-01 15:16:24 -0700 |
commit | 9e48238c39e6048550ac3e63dac88843ab402935 (patch) | |
tree | ae9d9e2b81600ceb160ef89ec59aec86fb1de6b5 /src/com/android | |
parent | 10fefb18c4f227f6a08fc24966800e49ce743be8 (diff) | |
download | android_packages_apps_Trebuchet-9e48238c39e6048550ac3e63dac88843ab402935.tar.gz android_packages_apps_Trebuchet-9e48238c39e6048550ac3e63dac88843ab402935.tar.bz2 android_packages_apps_Trebuchet-9e48238c39e6048550ac3e63dac88843ab402935.zip |
Fix crash in non-xlarge configurations.
Diffstat (limited to 'src/com/android')
-rw-r--r-- | src/com/android/launcher2/Launcher.java | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/src/com/android/launcher2/Launcher.java b/src/com/android/launcher2/Launcher.java index c14c22c27..6b1290de8 100644 --- a/src/com/android/launcher2/Launcher.java +++ b/src/com/android/launcher2/Launcher.java @@ -991,9 +991,13 @@ public final class Launcher extends Activity View createShortcut(int layoutResId, ViewGroup parent, ShortcutInfo info) { TextView favorite = (TextView) mInflater.inflate(layoutResId, parent, false); - // Temporarily, we are scaling up all shortcuts on the workspace - int scaledSize = parent.getResources().getDimensionPixelSize(R.dimen.temp_scaled_icon_size); - Bitmap b = Bitmap.createScaledBitmap(info.getIcon(mIconCache), scaledSize, scaledSize, true); + Bitmap b = info.getIcon(mIconCache); + + if (LauncherApplication.isScreenXLarge()) { + // Temporarily, we are scaling up all shortcuts on the workspace + int scaledSize = getResources().getDimensionPixelSize(R.dimen.temp_scaled_icon_size); + b = Bitmap.createScaledBitmap(b, scaledSize, scaledSize, true); + } favorite.setCompoundDrawablesWithIntrinsicBounds(null, new FastBitmapDrawable(b), |