mirror of
https://github.com/LawnchairLauncher/lawnchair.git
synced 2026-03-04 09:56:49 +00:00
All apps container should not intercept touch during animation.
b/28917826 > When all apps container is settling near either the bottom or top end, touch event should not be intercepted. Change-Id: I8aee6cea52e844c4615b92b15f8ef7247236a25b
This commit is contained in:
@@ -54,6 +54,8 @@ public class AllAppsTransitionController implements TouchController, VerticalPul
|
||||
private float mProgressTransY; // numerator
|
||||
private float mTranslation = -1; // denominator
|
||||
|
||||
private static final float RECATCH_REJECTION_FRACTION = .0875f;
|
||||
|
||||
private long mAnimationDuration;
|
||||
private float mCurY;
|
||||
|
||||
@@ -73,19 +75,19 @@ public class AllAppsTransitionController implements TouchController, VerticalPul
|
||||
mNoIntercept = false;
|
||||
if (mLauncher.getWorkspace().isInOverviewMode() || mLauncher.isWidgetsViewVisible()) {
|
||||
mNoIntercept = true;
|
||||
}
|
||||
if (mLauncher.isAllAppsVisible() &&
|
||||
} else if (mLauncher.isAllAppsVisible() &&
|
||||
!mAppsView.shouldContainerScroll(ev.getX(), ev.getY())) {
|
||||
mNoIntercept = true;
|
||||
} else {
|
||||
mDetector.setDetectableScrollConditions(mLauncher.isAllAppsVisible() /* down */,
|
||||
isInDisallowRecatchTopZone(), isInDisallowRecatchBottomZone());
|
||||
}
|
||||
}
|
||||
if (mNoIntercept) {
|
||||
return false;
|
||||
} else {
|
||||
mDetector.setScrollDirectionDown(mLauncher.isAllAppsVisible());
|
||||
}
|
||||
mDetector.onTouchEvent(ev);
|
||||
return mDetector.mScrolling;
|
||||
return mDetector.shouldIntercept();
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -93,6 +95,14 @@ public class AllAppsTransitionController implements TouchController, VerticalPul
|
||||
return mDetector.onTouchEvent(ev);
|
||||
}
|
||||
|
||||
private boolean isInDisallowRecatchTopZone() {
|
||||
return mProgressTransY / mTranslation < RECATCH_REJECTION_FRACTION;
|
||||
}
|
||||
|
||||
private boolean isInDisallowRecatchBottomZone() {
|
||||
return mProgressTransY / mTranslation > 1 - RECATCH_REJECTION_FRACTION;
|
||||
}
|
||||
|
||||
private void init() {
|
||||
if (mAppsView != null) {
|
||||
return;
|
||||
@@ -267,7 +277,7 @@ public class AllAppsTransitionController implements TouchController, VerticalPul
|
||||
if ((mAppsView = mLauncher.getAppsView()) == null || animationOut == null){
|
||||
return;
|
||||
}
|
||||
if (!mDetector.mScrolling) {
|
||||
if (mDetector.isRestingState()) {
|
||||
preparePull(true);
|
||||
mAnimationDuration = duration;
|
||||
}
|
||||
@@ -311,7 +321,7 @@ public class AllAppsTransitionController implements TouchController, VerticalPul
|
||||
if ((mAppsView = mLauncher.getAppsView()) == null || animationOut == null){
|
||||
return;
|
||||
}
|
||||
if(!mDetector.mScrolling) {
|
||||
if(mDetector.isRestingState()) {
|
||||
preparePull(true);
|
||||
mAnimationDuration = duration;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user