mirror of
https://github.com/LawnchairLauncher/lawnchair.git
synced 2026-03-02 17:06:49 +00:00
Merge "Delay hiding Taskbar EDU until entering home or overview." into tm-qpr-dev am: a1808c3e49
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Launcher3/+/20727418 Change-Id: I8ffc5766af32fb513c10a62d17a03c1f19e29236 Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
@@ -876,16 +876,6 @@ public class TaskbarActivityContext extends BaseTaskbarContext {
|
||||
mControllers.taskbarStashController.updateAndAnimateTransientTaskbar(false);
|
||||
}
|
||||
|
||||
/** Called when we want to hide the overlay window when user performs swipe up gesture. */
|
||||
public void onSwipeToHideOverlay() {
|
||||
mControllers.taskbarOverlayController.hideWindow();
|
||||
}
|
||||
|
||||
/** Returns {@code true} if taskbar is stashed. */
|
||||
public boolean isTaskbarStashed() {
|
||||
return mControllers.taskbarStashController.isStashed();
|
||||
}
|
||||
|
||||
/** Returns {@code true} if taskbar All Apps is open. */
|
||||
public boolean isTaskbarAllAppsOpen() {
|
||||
return mControllers.taskbarAllAppsController.isOpen();
|
||||
|
||||
@@ -54,11 +54,8 @@ public class TaskbarStashInputConsumer extends DelegateInputConsumer {
|
||||
private final float mScreenWidth;
|
||||
|
||||
private final int mTaskbarNavThresholdY;
|
||||
private final int mTaskbarAppWindowThresholdY;
|
||||
private final boolean mTaskbarAlreadyOpen;
|
||||
private final boolean mIsTaskbarAllAppsOpen;
|
||||
private boolean mHasPassedTaskbarNavThreshold;
|
||||
private boolean mHasPassedTaskbarAppWindowThreshold;
|
||||
|
||||
private final PointF mDownPos = new PointF();
|
||||
private final PointF mLastPos = new PointF();
|
||||
@@ -80,15 +77,8 @@ public class TaskbarStashInputConsumer extends DelegateInputConsumer {
|
||||
int taskbarNavThreshold = res.getDimensionPixelSize(ENABLE_TASKBAR_REVISED_THRESHOLDS.get()
|
||||
? R.dimen.taskbar_nav_threshold_v2
|
||||
: R.dimen.taskbar_nav_threshold);
|
||||
int taskbarAppWindowThreshold = res.getDimensionPixelSize(
|
||||
ENABLE_TASKBAR_REVISED_THRESHOLDS.get()
|
||||
? R.dimen.taskbar_app_window_threshold_v2
|
||||
: R.dimen.taskbar_app_window_threshold);
|
||||
int screenHeight = taskbarActivityContext.getDeviceProfile().heightPx;
|
||||
mTaskbarNavThresholdY = screenHeight - taskbarNavThreshold;
|
||||
mTaskbarAppWindowThresholdY = screenHeight - taskbarAppWindowThreshold;
|
||||
mTaskbarAlreadyOpen = mTaskbarActivityContext != null
|
||||
&& !mTaskbarActivityContext.isTaskbarStashed();
|
||||
mIsTaskbarAllAppsOpen =
|
||||
mTaskbarActivityContext != null && mTaskbarActivityContext.isTaskbarAllAppsOpen();
|
||||
|
||||
@@ -127,7 +117,6 @@ public class TaskbarStashInputConsumer extends DelegateInputConsumer {
|
||||
mLastPos.set(mDownPos);
|
||||
|
||||
mHasPassedTaskbarNavThreshold = false;
|
||||
mHasPassedTaskbarAppWindowThreshold = false;
|
||||
mTaskbarActivityContext.setAutohideSuspendFlag(
|
||||
FLAG_AUTOHIDE_SUSPEND_TOUCHING, true);
|
||||
if (isInArea(x)) {
|
||||
@@ -172,18 +161,11 @@ public class TaskbarStashInputConsumer extends DelegateInputConsumer {
|
||||
float dY = mLastPos.y - mDownPos.y;
|
||||
boolean passedTaskbarNavThreshold = dY < 0
|
||||
&& mLastPos.y < mTaskbarNavThresholdY;
|
||||
boolean passedTaskbarAppWindowThreshold = dY < 0
|
||||
&& mLastPos.y < mTaskbarAppWindowThresholdY;
|
||||
|
||||
if (!mHasPassedTaskbarNavThreshold && passedTaskbarNavThreshold) {
|
||||
mHasPassedTaskbarNavThreshold = true;
|
||||
mTaskbarActivityContext.onSwipeToUnstashTaskbar();
|
||||
}
|
||||
if (mTaskbarAlreadyOpen || (!mHasPassedTaskbarAppWindowThreshold
|
||||
&& passedTaskbarAppWindowThreshold)) {
|
||||
mHasPassedTaskbarAppWindowThreshold = true;
|
||||
mTaskbarActivityContext.onSwipeToHideOverlay();
|
||||
}
|
||||
|
||||
if (dY < 0) {
|
||||
dY = -OverScroll.dampedScroll(-dY, mTaskbarNavThresholdY);
|
||||
@@ -205,7 +187,6 @@ public class TaskbarStashInputConsumer extends DelegateInputConsumer {
|
||||
mTransitionCallback.onActionEnd();
|
||||
}
|
||||
mHasPassedTaskbarNavThreshold = false;
|
||||
mHasPassedTaskbarAppWindowThreshold = false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user