summaryrefslogtreecommitdiffstats
path: root/src/com/android
diff options
context:
space:
mode:
authorcretin45 <cretin45@gmail.com>2016-01-18 10:57:55 -0800
committercretin45 <cretin45@gmail.com>2016-01-18 10:59:13 -0800
commit6732817a2589390ba489c82a76763a40f6fd6501 (patch)
tree57a38bba4573bac6a40d2f9940087a862154d4c5 /src/com/android
parentab66f216141753ce2696c136fb9bee8c73c471a5 (diff)
downloadandroid_packages_apps_Trebuchet-6732817a2589390ba489c82a76763a40f6fd6501.tar.gz
android_packages_apps_Trebuchet-6732817a2589390ba489c82a76763a40f6fd6501.tar.bz2
android_packages_apps_Trebuchet-6732817a2589390ba489c82a76763a40f6fd6501.zip
Trebuchet: Fix landscape spacing issue
Don't keeping adding padding for the qsb on every orientation change. Issue-id: CYNGNOS-1640 Change-Id: Ibe1c8de8d5af2da1ba5e53648a468785db77a5ba
Diffstat (limited to 'src/com/android')
-rw-r--r--src/com/android/launcher3/DeviceProfile.java10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/com/android/launcher3/DeviceProfile.java b/src/com/android/launcher3/DeviceProfile.java
index 9a184333e..4c5d3ff41 100644
--- a/src/com/android/launcher3/DeviceProfile.java
+++ b/src/com/android/launcher3/DeviceProfile.java
@@ -99,6 +99,7 @@ public class DeviceProfile {
public boolean searchBarVisible;
private int searchBarSpaceWidthPx;
private int searchBarSpaceHeightPx;
+ private int defaultSearchBarSpaceHeightPx;
public DeviceProfile(Context context, InvariantDeviceProfile inv,
Point minSize, Point maxSize,
@@ -165,8 +166,10 @@ public class DeviceProfile {
// Search Bar
searchBarVisible = isSearchBarEnabled(context);
searchBarSpaceWidthPx = Math.min(searchBarSpaceWidthPx, widthPx);
+ defaultSearchBarSpaceHeightPx = getSearchBarTopOffset()
+ + res.getDimensionPixelSize(R.dimen.dynamic_grid_search_bar_height);
searchBarSpaceHeightPx = 2 * edgeMarginPx + (searchBarVisible ?
- searchBarSpaceHeightPx - getSearchBarTopOffset() : 3 * edgeMarginPx);
+ defaultSearchBarSpaceHeightPx - getSearchBarTopOffset() : 3 * edgeMarginPx);
}
/**
@@ -207,8 +210,9 @@ public class DeviceProfile {
// Search Bar
searchBarSpaceWidthPx = Math.min(widthPx,
res.getDimensionPixelSize(R.dimen.dynamic_grid_search_bar_max_width));
- searchBarSpaceHeightPx = getSearchBarTopOffset()
+ defaultSearchBarSpaceHeightPx = getSearchBarTopOffset()
+ res.getDimensionPixelSize(R.dimen.dynamic_grid_search_bar_height);
+ searchBarSpaceHeightPx = defaultSearchBarSpaceHeightPx;
// Calculate the actual text height
Paint textPaint = new Paint();
@@ -400,7 +404,7 @@ public class DeviceProfile {
if (hasVerticalBarLayout) {
// If search bar is invisible add some extra padding for the drop targets
searchBarSpaceHeightPx = searchBarVisible ? searchBarSpaceHeightPx
- : searchBarSpaceHeightPx + 5 * edgeMarginPx;
+ : defaultSearchBarSpaceHeightPx + 5 * edgeMarginPx;
// Vertical search bar space -- The search bar is fixed in the layout to be on the left
// of the screen regardless of RTL