diff options
author | Winson Chung <winsonc@google.com> | 2011-08-31 16:58:52 -0700 |
---|---|---|
committer | Winson Chung <winsonc@google.com> | 2011-08-31 17:06:17 -0700 |
commit | 128bbcd1e6606b3c1933c8e85a32b30b3e58ead3 (patch) | |
tree | d8a77924ed2d1180f1156eaae3886ad8f30751bc | |
parent | 46448f75b7336214d6c425adb9400029e92c3d9b (diff) | |
download | android_packages_apps_Trebuchet-128bbcd1e6606b3c1933c8e85a32b30b3e58ead3.tar.gz android_packages_apps_Trebuchet-128bbcd1e6606b3c1933c8e85a32b30b3e58ead3.tar.bz2 android_packages_apps_Trebuchet-128bbcd1e6606b3c1933c8e85a32b30b3e58ead3.zip |
Padding the new market button.
Change-Id: I293859d4041a05619cb144a82aa1122a70403719
-rw-r--r-- | res/values/dimens.xml | 5 | ||||
-rw-r--r-- | src/com/android/launcher2/Launcher.java | 10 |
2 files changed, 13 insertions, 2 deletions
diff --git a/res/values/dimens.xml b/res/values/dimens.xml index 5016894c1..df9319975 100644 --- a/res/values/dimens.xml +++ b/res/values/dimens.xml @@ -39,8 +39,13 @@ <!-- QSB --> <dimen name="toolbar_button_vertical_padding">0dip</dimen> <dimen name="toolbar_button_horizontal_padding">12dip</dimen> + <!-- External toolbar icon size (for bounds) --> + <dimen name="toolbar_external_icon_width">36dp</dimen> + <dimen name="toolbar_external_icon_height">36dp</dimen> <!-- AllApps/Customize/AppsCustomize --> + <!-- The height of the tab bar -- if this changes, we should update the + external icon width/height above to compensate --> <dimen name="apps_customize_tab_bar_height">56dp</dimen> <dimen name="app_icon_size">48dp</dimen> <!-- The width can be 72dp because we don't have L/R padding --> diff --git a/src/com/android/launcher2/Launcher.java b/src/com/android/launcher2/Launcher.java index 27382e85c..80f0261ed 100644 --- a/src/com/android/launcher2/Launcher.java +++ b/src/com/android/launcher2/Launcher.java @@ -2458,13 +2458,19 @@ public final class Launcher extends Activity int buttonId, ComponentName activityName, int fallbackDrawableId) { TextView button = (TextView) findViewById(buttonId); Drawable toolbarIcon = getExternalPackageToolbarIcon(activityName); + Resources r = getResources(); + int w = r.getDimensionPixelSize(R.dimen.toolbar_external_icon_width); + int h = r.getDimensionPixelSize(R.dimen.toolbar_external_icon_height); // If we were unable to find the icon via the meta-data, use a generic one if (toolbarIcon == null) { - button.setCompoundDrawablesWithIntrinsicBounds(fallbackDrawableId, 0, 0, 0); + toolbarIcon = r.getDrawable(fallbackDrawableId); + toolbarIcon.setBounds(0, 0, w, h); + button.setCompoundDrawables(toolbarIcon, null, null, null); return null; } else { - button.setCompoundDrawablesWithIntrinsicBounds(toolbarIcon, null, null, null); + toolbarIcon.setBounds(0, 0, w, h); + button.setCompoundDrawables(toolbarIcon, null, null, null); return toolbarIcon.getConstantState(); } } |