From 401aafed7995cb3b43eaae47590f4b17ae6e1ceb Mon Sep 17 00:00:00 2001 From: David Marble Date: Wed, 11 Jun 2014 14:21:14 -0500 Subject: Improve margins for small tablets We are currently allocating too much space on the side margins in landscape on small tablets with the searchbar hidden. This fixes the logic for determining the space. The margins to the left side and the hot seat are the same, rather than wider on the left side as they are now. Change-Id: Ic57aa4f850253f1ec1f8858b4a137c8d8a2ad534 --- src/com/android/launcher3/DeviceProfile.java | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/com/android/launcher3/DeviceProfile.java b/src/com/android/launcher3/DeviceProfile.java index b09f67edf..676f91b21 100644 --- a/src/com/android/launcher3/DeviceProfile.java +++ b/src/com/android/launcher3/DeviceProfile.java @@ -241,7 +241,7 @@ public class DeviceProfile { searchBarVisible = SettingsProvider.getBoolean(context, SettingsProvider.SETTINGS_UI_HOMESCREEN_SEARCH, R.bool.preferences_interface_homescreen_search_default); searchBarSpaceWidthPx = Math.min(searchBarSpaceMaxWidthPx, widthPx); - searchBarSpaceHeightPx = searchBarHeightPx + (searchBarVisible ? 2 * edgeMarginPx : 0); + searchBarSpaceHeightPx = 2 * edgeMarginPx + (searchBarVisible ? searchBarHeightPx : 0); } void addCallback(DeviceProfileCallbacks cb) { @@ -651,8 +651,7 @@ public class DeviceProfile { // Update search bar for live settings searchBarVisible = SettingsProvider.getBoolean(launcher, SettingsProvider.SETTINGS_UI_HOMESCREEN_SEARCH, R.bool.preferences_interface_homescreen_search_default); - searchBarSpaceHeightPx = searchBarHeightPx + (searchBarVisible ? 2 * edgeMarginPx : 0); - + searchBarSpaceHeightPx = 2 * edgeMarginPx + (searchBarVisible ? searchBarHeightPx : 0); FrameLayout.LayoutParams lp; Resources res = launcher.getResources(); boolean hasVerticalBarLayout = isVerticalBarLayout(); -- cgit v1.2.3