summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorAdam Cohen <adamcohen@google.com>2014-01-14 16:18:14 -0800
committerDanesh M <daneshm90@gmail.com>2014-06-06 22:54:25 -0700
commitd0a7b495fdfdfa52f4a533acbc26c0afa5984c4c (patch)
tree6aae3cc77a5feb7cbf61ab344fff2a1166fbb105 /src
parente86ae75fe286ff27394b4f49b4ba12c7d92769dd (diff)
downloadandroid_packages_apps_Trebuchet-d0a7b495fdfdfa52f4a533acbc26c0afa5984c4c.tar.gz
android_packages_apps_Trebuchet-d0a7b495fdfdfa52f4a533acbc26c0afa5984c4c.tar.bz2
android_packages_apps_Trebuchet-d0a7b495fdfdfa52f4a533acbc26c0afa5984c4c.zip
Fixing drop targets in phone / small tablet landscape (issue 12192781)
Change-Id: I4dc8a82c8cd5ef279506e7868e33a455fba5a3be
Diffstat (limited to 'src')
-rw-r--r--src/com/android/launcher3/DeviceProfile.java14
-rw-r--r--src/com/android/launcher3/FocusHelper.java2
-rw-r--r--src/com/android/launcher3/Launcher.java13
3 files changed, 13 insertions, 16 deletions
diff --git a/src/com/android/launcher3/DeviceProfile.java b/src/com/android/launcher3/DeviceProfile.java
index 67f3a974a..238dd22f4 100644
--- a/src/com/android/launcher3/DeviceProfile.java
+++ b/src/com/android/launcher3/DeviceProfile.java
@@ -628,10 +628,14 @@ public class DeviceProfile {
// Vertical search bar space
lp.gravity = Gravity.TOP | Gravity.LEFT;
lp.width = searchBarSpaceHeightPx;
- lp.height = LayoutParams.MATCH_PARENT;
+ lp.height = LayoutParams.WRAP_CONTENT;
searchBar.setPadding(
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);
} else {
// Horizontal search bar space
lp.gravity = Gravity.TOP | Gravity.CENTER_HORIZONTAL;
@@ -644,14 +648,6 @@ public class DeviceProfile {
}
searchBar.setLayoutParams(lp);
- // Layout the search bar
- View qsbBar = launcher.getQsbBar();
- qsbBar.setVisibility(searchBarVisible ? View.VISIBLE : View.GONE);
- LayoutParams vglp = qsbBar.getLayoutParams();
- vglp.width = LayoutParams.MATCH_PARENT;
- vglp.height = LayoutParams.MATCH_PARENT;
- qsbBar.setLayoutParams(vglp);
-
// Layout the voice proxy
View voiceButtonProxy = launcher.findViewById(R.id.voice_button_proxy);
if (voiceButtonProxy != null) {
diff --git a/src/com/android/launcher3/FocusHelper.java b/src/com/android/launcher3/FocusHelper.java
index 357af49f6..b92b17f22 100644
--- a/src/com/android/launcher3/FocusHelper.java
+++ b/src/com/android/launcher3/FocusHelper.java
@@ -548,7 +548,7 @@ public class FocusHelper {
final CellLayout layout = (CellLayout) parent.getParent();
final Workspace workspace = (Workspace) layout.getParent();
final ViewGroup launcher = (ViewGroup) workspace.getParent();
- final ViewGroup tabs = (ViewGroup) launcher.findViewById(R.id.qsb_bar);
+ final ViewGroup tabs = (ViewGroup) launcher.findViewById(R.id.search_drop_target_bar);
final ViewGroup hotseat = (ViewGroup) launcher.findViewById(R.id.hotseat);
int pageIndex = workspace.indexOfChild(layout);
int pageCount = workspace.getChildCount();
diff --git a/src/com/android/launcher3/Launcher.java b/src/com/android/launcher3/Launcher.java
index 861c627d8..274ac7e9b 100644
--- a/src/com/android/launcher3/Launcher.java
+++ b/src/com/android/launcher3/Launcher.java
@@ -278,7 +278,7 @@ public class Launcher extends Activity
private AppsCustomizeLayout mAppsCustomizeLayout;
private AppsCustomizePagedView mAppsCustomizeContent;
private boolean mAutoAdvanceRunning = false;
- private View mQsbBar;
+ private View mQsb;
private Bundle mSavedState;
// We set the state in both onCreate and then onNewIntent in some cases, which causes both
@@ -1453,7 +1453,8 @@ public class Launcher extends Activity
dragController.addDragListener(mWorkspace);
// Get the search/delete bar
- mSearchDropTargetBar = (SearchDropTargetBar) mDragLayer.findViewById(R.id.qsb_bar);
+ mSearchDropTargetBar = (SearchDropTargetBar)
+ mDragLayer.findViewById(R.id.search_drop_target_bar);
// Setup AppsCustomize
mAppsCustomizeLayout = (AppsCustomizeLayout) findViewById(R.id.apps_customize_pane);
@@ -3662,11 +3663,11 @@ public class Launcher extends Activity
}
public View getQsbBar() {
- if (mQsbBar == null) {
- mQsbBar = mInflater.inflate(R.layout.search_bar, mSearchDropTargetBar, false);
- mSearchDropTargetBar.addView(mQsbBar);
+ if (mQsb == null) {
+ mQsb = mInflater.inflate(R.layout.qsb, mSearchDropTargetBar, false);
+ mSearchDropTargetBar.addView(mQsb);
}
- return mQsbBar;
+ return mQsb;
}
protected boolean updateGlobalSearchIcon() {