Removing Launcher dependency in search box layout
Bug: 118758696 Change-Id: Id918c44b8bd2a97ab577481b7584afbe56e8a591
This commit is contained in:
parent
373e2534d3
commit
33611be973
|
@ -304,6 +304,8 @@ public class AllAppsContainerView extends SpringRelativeLayout implements DragSo
|
||||||
|
|
||||||
mNavBarScrimHeight = insets.bottom;
|
mNavBarScrimHeight = insets.bottom;
|
||||||
InsettableFrameLayout.dispatchInsets(this, insets);
|
InsettableFrameLayout.dispatchInsets(this, insets);
|
||||||
|
mLauncher.getAllAppsController()
|
||||||
|
.setScrollRangeDelta(mSearchUiManager.getScrollRangeDelta(insets));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -221,7 +221,7 @@ public class AllAppsTransitionController implements StateHandler, OnDeviceProfil
|
||||||
/**
|
/**
|
||||||
* Updates the total scroll range but does not update the UI.
|
* Updates the total scroll range but does not update the UI.
|
||||||
*/
|
*/
|
||||||
public void setScrollRangeDelta(float delta) {
|
void setScrollRangeDelta(float delta) {
|
||||||
mScrollRangeDelta = delta;
|
mScrollRangeDelta = delta;
|
||||||
mShiftRange = mLauncher.getDeviceProfile().heightPx - mScrollRangeDelta;
|
mShiftRange = mLauncher.getDeviceProfile().heightPx - mScrollRangeDelta;
|
||||||
|
|
||||||
|
|
|
@ -15,6 +15,7 @@
|
||||||
*/
|
*/
|
||||||
package com.android.launcher3.allapps;
|
package com.android.launcher3.allapps;
|
||||||
|
|
||||||
|
import android.graphics.Rect;
|
||||||
import android.view.KeyEvent;
|
import android.view.KeyEvent;
|
||||||
import android.view.animation.Interpolator;
|
import android.view.animation.Interpolator;
|
||||||
|
|
||||||
|
@ -41,6 +42,11 @@ public interface SearchUiManager {
|
||||||
*/
|
*/
|
||||||
void preDispatchKeyEvent(KeyEvent keyEvent);
|
void preDispatchKeyEvent(KeyEvent keyEvent);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns the vertical shift for the all-apps view, so that it aligns with the hotseat.
|
||||||
|
*/
|
||||||
|
float getScrollRangeDelta(Rect insets);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Called as part of state transition to update the content UI
|
* Called as part of state transition to update the content UI
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -208,13 +208,16 @@ public class AppsSearchContainerLayout extends ExtendedEditText
|
||||||
MarginLayoutParams mlp = (MarginLayoutParams) getLayoutParams();
|
MarginLayoutParams mlp = (MarginLayoutParams) getLayoutParams();
|
||||||
mlp.topMargin = Math.round(Math.max(-mFixedTranslationY, insets.top - mMarginTopAdjusting));
|
mlp.topMargin = Math.round(Math.max(-mFixedTranslationY, insets.top - mMarginTopAdjusting));
|
||||||
requestLayout();
|
requestLayout();
|
||||||
|
}
|
||||||
|
|
||||||
DeviceProfile dp = mLauncher.getDeviceProfile();
|
@Override
|
||||||
if (dp.isVerticalBarLayout()) {
|
public float getScrollRangeDelta(Rect insets) {
|
||||||
mLauncher.getAllAppsController().setScrollRangeDelta(0);
|
if (mLauncher.getDeviceProfile().isVerticalBarLayout()) {
|
||||||
|
return 0;
|
||||||
} else {
|
} else {
|
||||||
mLauncher.getAllAppsController().setScrollRangeDelta(
|
int topMargin = Math.round(Math.max(
|
||||||
insets.bottom + mlp.topMargin + mFixedTranslationY);
|
-mFixedTranslationY, insets.top - mMarginTopAdjusting));
|
||||||
|
return insets.bottom + topMargin + mFixedTranslationY;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue