diff options
author | Sunny Goyal <sunnygoyal@google.com> | 2017-05-17 11:34:33 -0700 |
---|---|---|
committer | Sunny Goyal <sunnygoyal@google.com> | 2017-05-17 11:36:31 -0700 |
commit | 0dc1db4feed74e1b5ba706d473e83c426482daaf (patch) | |
tree | 082068ed94959a5c5875877e9067b5ad048cdd62 /src/com/android/launcher3/allapps | |
parent | 9863ea5dc7cbda4888fca4976fb4514bf3ddd7e4 (diff) | |
download | android_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/com/android/launcher3/allapps')
-rw-r--r-- | src/com/android/launcher3/allapps/search/AppsSearchContainerLayout.java | 13 |
1 files changed, 11 insertions, 2 deletions
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); } |