From d9cc780fade7a078d127c7e5b8209d414a46f0a5 Mon Sep 17 00:00:00 2001 From: Sunny Goyal Date: Thu, 23 Apr 2015 14:47:19 -0700 Subject: Making QSB alingment match with that of recents Change-Id: I6be59c721cbd163641013ca6c5e1776cf2162a0d --- res/layout/search_drop_target_bar.xml | 3 +-- src/com/android/launcher3/DeviceProfile.java | 14 +++++++++----- 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/res/layout/search_drop_target_bar.xml b/res/layout/search_drop_target_bar.xml index 9b0da1d4e..e383d74c0 100644 --- a/res/layout/search_drop_target_bar.xml +++ b/res/layout/search_drop_target_bar.xml @@ -17,8 +17,7 @@ + android:focusable="false" > diff --git a/src/com/android/launcher3/DeviceProfile.java b/src/com/android/launcher3/DeviceProfile.java index 22fb6a049..40998a52a 100644 --- a/src/com/android/launcher3/DeviceProfile.java +++ b/src/com/android/launcher3/DeviceProfile.java @@ -734,7 +734,6 @@ public class DeviceProfile { public void layout(Launcher launcher) { FrameLayout.LayoutParams lp; - Resources res = launcher.getResources(); boolean hasVerticalBarLayout = isVerticalBarLayout(); // Layout the search bar space @@ -742,17 +741,22 @@ public class DeviceProfile { lp = (FrameLayout.LayoutParams) searchBar.getLayoutParams(); if (hasVerticalBarLayout) { // Vertical search bar space - lp.gravity = Gravity.TOP | Gravity.LEFT; + lp.gravity = Gravity.LEFT; lp.width = searchBarSpaceHeightPx; - lp.height = LayoutParams.WRAP_CONTENT; LinearLayout targets = (LinearLayout) searchBar.findViewById(R.id.drag_target_bar); targets.setOrientation(LinearLayout.VERTICAL); + FrameLayout.LayoutParams targetsLp = (FrameLayout.LayoutParams) targets.getLayoutParams(); + targetsLp.gravity = Gravity.TOP; + targetsLp.height = LayoutParams.WRAP_CONTENT; + } else { // Horizontal search bar space - lp.gravity = Gravity.TOP | Gravity.CENTER_HORIZONTAL; - lp.width = searchBarSpaceWidthPx; + lp.gravity = Gravity.TOP; lp.height = searchBarSpaceHeightPx; + + LinearLayout targets = (LinearLayout) searchBar.findViewById(R.id.drag_target_bar); + targets.getLayoutParams().width = searchBarSpaceWidthPx; } searchBar.setLayoutParams(lp); -- cgit v1.2.3