summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRaj Yengisetty <rajesh@cyngn.com>2014-08-09 00:19:08 (GMT)
committerGerrit Code Review <gerrit@cyanogenmod.org>2014-08-15 17:28:48 (GMT)
commit90c07b45d70df93395d2e9b9b384785df5f150be (patch)
treeffbce8d88caef00aa3c843ff296d871531bc78d1
parent562b36032fa60424ca974c0985046f5587f2e8e4 (diff)
downloadandroid_packages_apps_Trebuchet-90c07b45d70df93395d2e9b9b384785df5f150be.zip
android_packages_apps_Trebuchet-90c07b45d70df93395d2e9b9b384785df5f150be.tar.gz
android_packages_apps_Trebuchet-90c07b45d70df93395d2e9b9b384785df5f150be.tar.bz2
Fix AppInfo drop target getting cut off when search bar is off.
https://jira.cyanogenmod.org/browse/CYAN-4665 Change-Id: Id1db2c19430bb5c617ab53383fd25625980e9acf
-rw-r--r--src/com/android/launcher3/DeviceProfile.java15
1 files changed, 8 insertions, 7 deletions
diff --git a/src/com/android/launcher3/DeviceProfile.java b/src/com/android/launcher3/DeviceProfile.java
index 99819ca..ec6e47f 100644
--- a/src/com/android/launcher3/DeviceProfile.java
+++ b/src/com/android/launcher3/DeviceProfile.java
@@ -297,7 +297,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 = 2 * edgeMarginPx + (searchBarVisible ? searchBarHeightPx : 2 * edgeMarginPx);
+ searchBarSpaceHeightPx = 2 * edgeMarginPx + (searchBarVisible ? searchBarHeightPx : 3 * edgeMarginPx);
}
void addCallback(DeviceProfileCallbacks cb) {
@@ -382,9 +382,9 @@ public class DeviceProfile {
hotseatIconSizePx = (int) (DynamicGrid.pxFromDp(hotseatIconSize, dm) * scale);
// Search Bar
- searchBarSpaceWidthPx = Math.min(searchBarSpaceMaxWidthPx, widthPx);
searchBarSpaceMaxWidthPx = resources.getDimensionPixelSize(R.dimen.dynamic_grid_search_bar_max_width);
searchBarHeightPx = resources.getDimensionPixelSize(R.dimen.dynamic_grid_search_bar_height);
+ searchBarSpaceWidthPx = Math.min(searchBarSpaceMaxWidthPx, widthPx);
searchBarSpaceHeightPx = searchBarHeightPx + getSearchBarTopOffset();
// Calculate the actual text height
@@ -707,15 +707,19 @@ 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 = 2 * edgeMarginPx + (searchBarVisible ? searchBarHeightPx : 2 * edgeMarginPx);
+ searchBarSpaceHeightPx = 2 * edgeMarginPx + (searchBarVisible ? searchBarHeightPx : 3 * edgeMarginPx);
FrameLayout.LayoutParams lp;
Resources res = launcher.getResources();
boolean hasVerticalBarLayout = isVerticalBarLayout();
// Layout the search bar space
View searchBar = launcher.getSearchBar();
+ LinearLayout dropTargetBar = (LinearLayout) launcher.getSearchBar().getDropTargetBar();
lp = (FrameLayout.LayoutParams) searchBar.getLayoutParams();
if (hasVerticalBarLayout) {
+ // If search bar is invisible add some extra padding for the drop targets
+ searchBarSpaceHeightPx = searchBarVisible ? searchBarSpaceHeightPx
+ : searchBarSpaceHeightPx + 5 * edgeMarginPx;
// Vertical search bar space
lp.gravity = Gravity.TOP | Gravity.LEFT;
lp.width = searchBarSpaceHeightPx;
@@ -724,9 +728,7 @@ public class DeviceProfile {
0, 2 * edgeMarginPx, 0,
2 * edgeMarginPx);
- searchBar.setVisibility(searchBarVisible ? View.VISIBLE : View.GONE);
- LinearLayout targets = (LinearLayout) searchBar.findViewById(R.id.drag_target_bar);
- targets.setOrientation(LinearLayout.VERTICAL);
+ dropTargetBar.setOrientation(LinearLayout.VERTICAL);
} else {
// Horizontal search bar space
lp.gravity = Gravity.TOP | Gravity.CENTER_HORIZONTAL;
@@ -740,7 +742,6 @@ public class DeviceProfile {
searchBar.setLayoutParams(lp);
// Layout the drop target icons
- LinearLayout dropTargetBar = (LinearLayout) launcher.getSearchBar().getDropTargetBar();
if (hasVerticalBarLayout) {
dropTargetBar.setOrientation(LinearLayout.VERTICAL);
} else {