diff options
author | Tony Wickham <twickham@google.com> | 2016-02-01 14:15:20 -0800 |
---|---|---|
committer | Tony Wickham <twickham@google.com> | 2016-02-01 14:15:37 -0800 |
commit | 8a75806c1a22b79d6c343f0057f1cc55b2a62ed3 (patch) | |
tree | d2c238e98e44884d113036611a80c6200a9c5f54 /src | |
parent | 6362683acb884ec72fe10f1cf394d178d3918a96 (diff) | |
download | android_packages_apps_Trebuchet-8a75806c1a22b79d6c343f0057f1cc55b2a62ed3.tar.gz android_packages_apps_Trebuchet-8a75806c1a22b79d6c343f0057f1cc55b2a62ed3.tar.bz2 android_packages_apps_Trebuchet-8a75806c1a22b79d6c343f0057f1cc55b2a62ed3.zip |
Add extra space for the search bar.
Also fixed a broken test.
Change-Id: I1c270e69617528ea30f0e26a2101673e9b9fa63c
Diffstat (limited to 'src')
-rw-r--r-- | src/com/android/launcher3/DeviceProfile.java | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/src/com/android/launcher3/DeviceProfile.java b/src/com/android/launcher3/DeviceProfile.java index c6da5844a..61c4b1a22 100644 --- a/src/com/android/launcher3/DeviceProfile.java +++ b/src/com/android/launcher3/DeviceProfile.java @@ -103,6 +103,8 @@ public class DeviceProfile { // QSB private int searchBarWidgetInternalPaddingTop, searchBarWidgetInternalPaddingBottom; private int searchBarTopPaddingPx; + private int tallSearchBarNegativeTopPaddingPx, normalSearchBarTopExtraPaddingPx; + private int searchBarTopExtraPaddingPx; // One of the above. private int normalSearchBarBottomPaddingPx, tallSearchBarBottomPaddingPx; private int searchBarBottomPaddingPx; // One of the above. private int normalSearchBarSpaceHeightPx, tallSearchBarSpaceHeightPx; @@ -216,6 +218,10 @@ public class DeviceProfile { R.dimen.qsb_internal_padding_top); searchBarWidgetInternalPaddingBottom = res.getDimensionPixelSize( R.dimen.qsb_internal_padding_bottom); + normalSearchBarTopExtraPaddingPx = res.getDimensionPixelSize( + R.dimen.dynamic_grid_search_bar_extra_top_padding); + tallSearchBarNegativeTopPaddingPx = res.getDimensionPixelSize( + R.dimen.dynamic_grid_search_bar_negative_top_padding_short); if (isTablet && !isVerticalBarLayout()) { searchBarTopPaddingPx = searchBarWidgetInternalPaddingTop; normalSearchBarBottomPaddingPx = searchBarWidgetInternalPaddingBottom + @@ -225,8 +231,9 @@ public class DeviceProfile { searchBarTopPaddingPx = searchBarWidgetInternalPaddingTop; normalSearchBarBottomPaddingPx = searchBarWidgetInternalPaddingBottom + res.getDimensionPixelSize(R.dimen.dynamic_grid_search_bar_bottom_padding); - tallSearchBarBottomPaddingPx = searchBarWidgetInternalPaddingBottom + - res.getDimensionPixelSize(R.dimen.dynamic_grid_search_bar_bottom_padding_short); + tallSearchBarBottomPaddingPx = searchBarWidgetInternalPaddingBottom + + res.getDimensionPixelSize( + R.dimen.dynamic_grid_search_bar_bottom_negative_padding_short); } // Calculate the actual text height @@ -272,7 +279,7 @@ public class DeviceProfile { /** Returns the amount of extra space to allocate to the search bar for vertical padding. */ private int getSearchBarTotalVerticalPadding() { - return searchBarTopPaddingPx + searchBarBottomPaddingPx; + return searchBarTopPaddingPx + searchBarTopExtraPaddingPx + searchBarBottomPaddingPx; } /** Returns the width and height of the search bar, ignoring any padding. */ @@ -427,10 +434,13 @@ public class DeviceProfile { hotseatBarHeightPx = shortHotseatBarHeightPx; searchBarSpaceHeightPx = tallSearchBarSpaceHeightPx; searchBarBottomPaddingPx = tallSearchBarBottomPaddingPx; + searchBarTopExtraPaddingPx = isPhone ? tallSearchBarNegativeTopPaddingPx + : normalSearchBarTopExtraPaddingPx; } else { hotseatBarHeightPx = normalHotseatBarHeightPx; searchBarSpaceHeightPx = normalSearchBarSpaceHeightPx; searchBarBottomPaddingPx = normalSearchBarBottomPaddingPx; + searchBarTopExtraPaddingPx = normalSearchBarTopExtraPaddingPx; } } @@ -445,6 +455,7 @@ public class DeviceProfile { lp = (FrameLayout.LayoutParams) searchBar.getLayoutParams(); lp.width = searchBarBounds.width(); lp.height = searchBarBounds.height(); + lp.topMargin = searchBarTopExtraPaddingPx; if (hasVerticalBarLayout) { // Vertical search bar space -- The search bar is fixed in the layout to be on the left // of the screen regardless of RTL |