mirror of
https://github.com/LawnchairLauncher/lawnchair.git
synced 2026-03-03 17:36:49 +00:00
Merge "Use dY to determine if taskbar nav threshold is met." into tm-qpr-dev
This commit is contained in:
@@ -52,7 +52,7 @@ public class TaskbarStashInputConsumer extends DelegateInputConsumer {
|
||||
private final float mUnstashArea;
|
||||
private final float mScreenWidth;
|
||||
|
||||
private final int mTaskbarNavThresholdY;
|
||||
private final int mTaskbarNavThreshold;
|
||||
private final boolean mIsTaskbarAllAppsOpen;
|
||||
private boolean mHasPassedTaskbarNavThreshold;
|
||||
|
||||
@@ -73,9 +73,7 @@ public class TaskbarStashInputConsumer extends DelegateInputConsumer {
|
||||
|
||||
Resources res = context.getResources();
|
||||
mUnstashArea = res.getDimensionPixelSize(R.dimen.taskbar_unstash_input_area);
|
||||
int taskbarNavThreshold = res.getDimensionPixelSize(R.dimen.taskbar_nav_threshold);
|
||||
int screenHeight = taskbarActivityContext.getDeviceProfile().heightPx;
|
||||
mTaskbarNavThresholdY = screenHeight - taskbarNavThreshold;
|
||||
mTaskbarNavThreshold = res.getDimensionPixelSize(R.dimen.taskbar_nav_threshold);
|
||||
mIsTaskbarAllAppsOpen =
|
||||
mTaskbarActivityContext != null && mTaskbarActivityContext.isTaskbarAllAppsOpen();
|
||||
|
||||
@@ -157,7 +155,7 @@ public class TaskbarStashInputConsumer extends DelegateInputConsumer {
|
||||
if (mIsTransientTaskbar) {
|
||||
float dY = mLastPos.y - mDownPos.y;
|
||||
boolean passedTaskbarNavThreshold = dY < 0
|
||||
&& mLastPos.y < mTaskbarNavThresholdY;
|
||||
&& Math.abs(dY) >= mTaskbarNavThreshold;
|
||||
|
||||
if (!mHasPassedTaskbarNavThreshold && passedTaskbarNavThreshold) {
|
||||
mHasPassedTaskbarNavThreshold = true;
|
||||
@@ -165,7 +163,7 @@ public class TaskbarStashInputConsumer extends DelegateInputConsumer {
|
||||
}
|
||||
|
||||
if (dY < 0) {
|
||||
dY = -OverScroll.dampedScroll(-dY, mTaskbarNavThresholdY);
|
||||
dY = -OverScroll.dampedScroll(-dY, mTaskbarNavThreshold);
|
||||
if (mTransitionCallback != null && !mIsTaskbarAllAppsOpen) {
|
||||
mTransitionCallback.onActionMove(dY);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user