summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorcretin45 <cretin45@gmail.com>2016-01-18 10:57:55 -0800
committerTom Powell <zifnab@zifnab06.net>2017-03-26 16:14:44 -0700
commite2cfb5efdc4c6430c7a03fe410468e19518dd446 (patch)
treea6bd0492125fb15b56424dae76b4641962b29ca4
parentec9e531a63e193af4e90048f7faee3ef5904c6b7 (diff)
downloadandroid_packages_apps_Trebuchet-e2cfb5efdc4c6430c7a03fe410468e19518dd446.zip
android_packages_apps_Trebuchet-e2cfb5efdc4c6430c7a03fe410468e19518dd446.tar.gz
android_packages_apps_Trebuchet-e2cfb5efdc4c6430c7a03fe410468e19518dd446.tar.bz2
Trebuchet: Fix landscape spacing issue
Don't keeping adding padding for the qsb on every orientation change. Issue-id: CYNGNOS-1640 Change-Id: Ibe1c8de8d5af2da1ba5e53648a468785db77a5ba
-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 9a18433..4c5d3ff 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