summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDanesh M <daneshm90@gmail.com>2015-09-30 03:34:09 (GMT)
committerGerrit Code Review <gerrit@cyanogenmod.org>2015-09-30 22:16:28 (GMT)
commitb5f1c45c02ef14443c88e50d1b0bffee76a75585 (patch)
tree9d796c404414f3e88c9d10430f1a3b330a037b05
parent1f9ba38cec29ae3dfcb3c3592389676c0f1a87ab (diff)
downloadandroid_packages_apps_Trebuchet-b5f1c45c02ef14443c88e50d1b0bffee76a75585.zip
android_packages_apps_Trebuchet-b5f1c45c02ef14443c88e50d1b0bffee76a75585.tar.gz
android_packages_apps_Trebuchet-b5f1c45c02ef14443c88e50d1b0bffee76a75585.tar.bz2
Trebuchet : Ensure search bar doesn't show in hidden
If the user is in the app drawer, or settings panel mode, a broadcast could cause a new search target bar to be added which would reset visibility. Ensure visibility is restored. Change-Id: I9eba1eb6ac36bc9873deab1b81e1bb00ee8d4999
-rw-r--r--src/com/android/launcher3/DeviceProfile.java11
-rw-r--r--src/com/android/launcher3/Launcher.java5
-rw-r--r--src/com/android/launcher3/SearchDropTargetBar.java8
3 files changed, 16 insertions, 8 deletions
diff --git a/src/com/android/launcher3/DeviceProfile.java b/src/com/android/launcher3/DeviceProfile.java
index d65b475..8bba13c 100644
--- a/src/com/android/launcher3/DeviceProfile.java
+++ b/src/com/android/launcher3/DeviceProfile.java
@@ -766,11 +766,9 @@ public class DeviceProfile {
(visibleChildCount-1) * overviewModeBarSpacerWidthPx;
}
- public void layout(Launcher launcher) {
+ public void layoutSearchBar(Launcher launcher) {
// Update search bar for live settings
searchBarVisible = isSearchBarEnabled(launcher);
- searchBarSpaceHeightPx = 2 * edgeMarginPx + (searchBarVisible ?
- searchBarSpaceHeightPx - getSearchBarTopOffset() : 3 * edgeMarginPx);
FrameLayout.LayoutParams lp;
Resources res = launcher.getResources();
boolean hasVerticalBarLayout = isVerticalBarLayout();
@@ -818,10 +816,15 @@ public class DeviceProfile {
vglp.height = LayoutParams.MATCH_PARENT;
qsbBar.setLayoutParams(vglp);
}
+ }
+ public void layout(Launcher launcher) {
+ layoutSearchBar(launcher);
+ Resources res = launcher.getResources();
+ boolean hasVerticalBarLayout = isVerticalBarLayout();
// Layout the workspace
PagedView workspace = (PagedView) launcher.findViewById(R.id.workspace);
- lp = (FrameLayout.LayoutParams) workspace.getLayoutParams();
+ FrameLayout.LayoutParams lp = (FrameLayout.LayoutParams) workspace.getLayoutParams();
lp.gravity = Gravity.CENTER;
int orientation = isLandscape ? CellLayout.LANDSCAPE : CellLayout.PORTRAIT;
Rect padding = getWorkspacePadding(orientation);
diff --git a/src/com/android/launcher3/Launcher.java b/src/com/android/launcher3/Launcher.java
index 1603200..1dafd12 100644
--- a/src/com/android/launcher3/Launcher.java
+++ b/src/com/android/launcher3/Launcher.java
@@ -5247,10 +5247,7 @@ public class Launcher extends Activity
mQsb = null;
}
mSearchDropTargetBar.setQsbSearchBar(getQsbBar());
- if (mDragController.isDragging()) {
- mDragController.cancelDrag();
- }
- updateDynamicGrid(false);
+ mGrid.layoutSearchBar(this);
}
/**
diff --git a/src/com/android/launcher3/SearchDropTargetBar.java b/src/com/android/launcher3/SearchDropTargetBar.java
index b58964b..38daadd 100644
--- a/src/com/android/launcher3/SearchDropTargetBar.java
+++ b/src/com/android/launcher3/SearchDropTargetBar.java
@@ -80,8 +80,16 @@ public class SearchDropTargetBar extends FrameLayout implements DragController.D
}
public void setQsbSearchBar(View qsb) {
+ float alpha = 1f;
+ int visibility = View.VISIBLE;
+ if (mQSBSearchBar != null) {
+ alpha = mQSBSearchBar.getAlpha();
+ visibility = mQSBSearchBar.getVisibility();
+ }
mQSBSearchBar = qsb;
if (mQSBSearchBar != null) {
+ mQSBSearchBar.setAlpha(alpha);
+ mQSBSearchBar.setVisibility(visibility);
if (mEnableDropDownDropTargets) {
mQSBSearchBarAnim = LauncherAnimUtils.ofFloat(mQSBSearchBar, "translationY", 0,
-mBarHeight);