mirror of
https://github.com/LawnchairLauncher/lawnchair.git
synced 2026-03-04 09:56:49 +00:00
Using common fling detection logic for notification and all-apps
> Refactoring SwipeDetector to both allow vertical and horizontal swipes > Using SwipeDetector and common overscroll effect for notification swipes instead of a separate logic Change-Id: Ib706ee179811ade59ddb68184e1c202365d147c4
This commit is contained in:
@@ -107,8 +107,7 @@ public class AllAppsTransitionController implements TouchController, SwipeDetect
|
||||
|
||||
public AllAppsTransitionController(Launcher l) {
|
||||
mLauncher = l;
|
||||
mDetector = new SwipeDetector(l);
|
||||
mDetector.setListener(this);
|
||||
mDetector = new SwipeDetector(l, this, SwipeDetector.VERTICAL);
|
||||
mShiftRange = DEFAULT_SHIFT_RANGE;
|
||||
mProgress = 1f;
|
||||
|
||||
@@ -137,15 +136,15 @@ public class AllAppsTransitionController implements TouchController, SwipeDetect
|
||||
|
||||
if (mDetector.isIdleState()) {
|
||||
if (mLauncher.isAllAppsVisible()) {
|
||||
directionsToDetectScroll |= SwipeDetector.DIRECTION_DOWN;
|
||||
directionsToDetectScroll |= SwipeDetector.DIRECTION_NEGATIVE;
|
||||
} else {
|
||||
directionsToDetectScroll |= SwipeDetector.DIRECTION_UP;
|
||||
directionsToDetectScroll |= SwipeDetector.DIRECTION_POSITIVE;
|
||||
}
|
||||
} else {
|
||||
if (isInDisallowRecatchBottomZone()) {
|
||||
directionsToDetectScroll |= SwipeDetector.DIRECTION_UP;
|
||||
directionsToDetectScroll |= SwipeDetector.DIRECTION_POSITIVE;
|
||||
} else if (isInDisallowRecatchTopZone()) {
|
||||
directionsToDetectScroll |= SwipeDetector.DIRECTION_DOWN;
|
||||
directionsToDetectScroll |= SwipeDetector.DIRECTION_NEGATIVE;
|
||||
} else {
|
||||
directionsToDetectScroll |= SwipeDetector.DIRECTION_BOTH;
|
||||
ignoreSlopWhenSettling = true;
|
||||
@@ -368,7 +367,7 @@ public class AllAppsTransitionController implements TouchController, SwipeDetect
|
||||
}
|
||||
|
||||
private void calculateDuration(float velocity, float disp) {
|
||||
mAnimationDuration = mDetector.calculateDuration(velocity, disp / mShiftRange);
|
||||
mAnimationDuration = SwipeDetector.calculateDuration(velocity, disp / mShiftRange);
|
||||
}
|
||||
|
||||
public boolean animateToAllApps(AnimatorSet animationOut, long duration) {
|
||||
|
||||
Reference in New Issue
Block a user