summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorSunny Goyal <sunnygoyal@google.com>2017-05-17 11:34:33 -0700
committerSunny Goyal <sunnygoyal@google.com>2017-05-17 11:36:31 -0700
commit0dc1db4feed74e1b5ba706d473e83c426482daaf (patch)
tree082068ed94959a5c5875877e9067b5ad048cdd62 /src
parent9863ea5dc7cbda4888fca4976fb4514bf3ddd7e4 (diff)
downloadandroid_packages_apps_Trebuchet-0dc1db4feed74e1b5ba706d473e83c426482daaf.tar.gz
android_packages_apps_Trebuchet-0dc1db4feed74e1b5ba706d473e83c426482daaf.tar.bz2
android_packages_apps_Trebuchet-0dc1db4feed74e1b5ba706d473e83c426482daaf.zip
Aligning the search box with bottom of hotseat icons
Bug: 37616877 Change-Id: I153e754db8e6c96b47ab644e19ce110f56bf852e
Diffstat (limited to 'src')
-rw-r--r--src/com/android/launcher3/DeviceProfile.java6
-rw-r--r--src/com/android/launcher3/allapps/search/AppsSearchContainerLayout.java13
2 files changed, 14 insertions, 5 deletions
diff --git a/src/com/android/launcher3/DeviceProfile.java b/src/com/android/launcher3/DeviceProfile.java
index 2d1ebf114..508fc3406 100644
--- a/src/com/android/launcher3/DeviceProfile.java
+++ b/src/com/android/launcher3/DeviceProfile.java
@@ -113,9 +113,9 @@ public class DeviceProfile {
public int hotseatCellHeightPx;
public int hotseatIconSizePx;
public int hotseatBarHeightPx;
- private int hotseatBarTopPaddingPx;
- private int hotseatBarBottomPaddingPx;
- private int hotseatLandGutterPx;
+ public int hotseatBarTopPaddingPx;
+ public int hotseatBarBottomPaddingPx;
+ public int hotseatLandGutterPx;
// All apps
public int allAppsNumCols;
diff --git a/src/com/android/launcher3/allapps/search/AppsSearchContainerLayout.java b/src/com/android/launcher3/allapps/search/AppsSearchContainerLayout.java
index f785e4cdb..126a02c73 100644
--- a/src/com/android/launcher3/allapps/search/AppsSearchContainerLayout.java
+++ b/src/com/android/launcher3/allapps/search/AppsSearchContainerLayout.java
@@ -16,6 +16,7 @@
package com.android.launcher3.allapps.search;
import android.content.Context;
+import android.graphics.Rect;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import android.text.Selection;
@@ -29,6 +30,7 @@ import android.view.KeyEvent;
import android.view.View;
import android.widget.FrameLayout;
+import com.android.launcher3.DeviceProfile;
import com.android.launcher3.ExtendedEditText;
import com.android.launcher3.Launcher;
import com.android.launcher3.R;
@@ -52,6 +54,7 @@ public class AppsSearchContainerLayout extends FrameLayout
private final Launcher mLauncher;
private final int mMinHeight;
+ private final int mSearchBoxHeight;
private final AllAppsSearchBarController mSearchBarController;
private final SpannableStringBuilder mSearchQueryBuilder;
private final HeaderElevationController mElevationController;
@@ -74,6 +77,8 @@ public class AppsSearchContainerLayout extends FrameLayout
mLauncher = Launcher.getLauncher(context);
mMinHeight = getResources().getDimensionPixelSize(R.dimen.all_apps_search_bar_height);
+ mSearchBoxHeight = getResources()
+ .getDimensionPixelSize(R.dimen.all_apps_search_bar_field_height);
mSearchBarController = new AllAppsSearchBarController();
mElevationController = new HeaderElevationController(this);
@@ -200,8 +205,12 @@ public class AppsSearchContainerLayout extends FrameLayout
@Override
public void onLayoutChange(View v, int left, int top, int right, int bottom,
int oldLeft, int oldTop, int oldRight, int oldBottom) {
- if (!mLauncher.getDeviceProfile().isVerticalBarLayout()) {
- listener.onScrollRangeChanged(top);
+ DeviceProfile dp = mLauncher.getDeviceProfile();
+ if (!dp.isVerticalBarLayout()) {
+ Rect insets = mLauncher.getDragLayer().getInsets();
+ int hotseatBottom = bottom - dp.hotseatBarBottomPaddingPx - insets.bottom;
+ int searchTopMargin = insets.top + (mMinHeight - mSearchBoxHeight);
+ listener.onScrollRangeChanged(hotseatBottom - searchTopMargin);
} else {
listener.onScrollRangeChanged(bottom);
}