diff options
author | Hyunyoung Song <hyunyoungs@google.com> | 2016-07-01 01:33:51 +0000 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2016-07-01 01:33:51 +0000 |
commit | 5a2af756ea9ca3e557978021c7c4b75f79d50d9e (patch) | |
tree | ff092098b4cc1562ba3f46191bd01d8c13d304a1 /src/com/android/launcher3/allapps/AllAppsTransitionController.java | |
parent | 310a9889937677091868ae7759c90d033ca08bb6 (diff) | |
parent | 21b7571b6931f4574e4ea59f3182c06b857ea8cc (diff) | |
download | android_packages_apps_Trebuchet-5a2af756ea9ca3e557978021c7c4b75f79d50d9e.tar.gz android_packages_apps_Trebuchet-5a2af756ea9ca3e557978021c7c4b75f79d50d9e.tar.bz2 android_packages_apps_Trebuchet-5a2af756ea9ca3e557978021c7c4b75f79d50d9e.zip |
Merge "Get rid of CATCH state in verticalpulldetector" into ub-launcher3-calgary
Diffstat (limited to 'src/com/android/launcher3/allapps/AllAppsTransitionController.java')
-rw-r--r-- | src/com/android/launcher3/allapps/AllAppsTransitionController.java | 36 |
1 files changed, 19 insertions, 17 deletions
diff --git a/src/com/android/launcher3/allapps/AllAppsTransitionController.java b/src/com/android/launcher3/allapps/AllAppsTransitionController.java index ac256b126..3ae8cd8fa 100644 --- a/src/com/android/launcher3/allapps/AllAppsTransitionController.java +++ b/src/com/android/launcher3/allapps/AllAppsTransitionController.java @@ -11,7 +11,6 @@ import android.view.animation.AccelerateInterpolator; import android.view.animation.DecelerateInterpolator; import android.view.animation.Interpolator; -import com.android.launcher3.CellLayout; import com.android.launcher3.DeviceProfile; import com.android.launcher3.Hotseat; import com.android.launcher3.Launcher; @@ -100,31 +99,34 @@ public class AllAppsTransitionController implements TouchController, VerticalPul } else { // Now figure out which direction scroll events the controller will start // calling the callbacks. - int conditionsToReportScroll = 0; + int directionsToDetectScroll = 0; + boolean ignoreSlopWhenSettling = false; - if (mDetector.isRestingState()) { + if (mDetector.isIdleState()) { if (mLauncher.isAllAppsVisible()) { - conditionsToReportScroll |= VerticalPullDetector.THRESHOLD_DOWN; + directionsToDetectScroll |= VerticalPullDetector.DIRECTION_DOWN; } else { - conditionsToReportScroll |= VerticalPullDetector.THRESHOLD_UP; + directionsToDetectScroll |= VerticalPullDetector.DIRECTION_UP; } } else { if (isInDisallowRecatchBottomZone()) { - conditionsToReportScroll |= VerticalPullDetector.THRESHOLD_UP; + directionsToDetectScroll |= VerticalPullDetector.DIRECTION_UP; } else if (isInDisallowRecatchTopZone()) { - conditionsToReportScroll |= VerticalPullDetector.THRESHOLD_DOWN; + directionsToDetectScroll |= VerticalPullDetector.DIRECTION_DOWN; } else { - conditionsToReportScroll |= VerticalPullDetector.THRESHOLD_ONLY; + directionsToDetectScroll |= VerticalPullDetector.DIRECTION_BOTH; + ignoreSlopWhenSettling = true; } } - mDetector.setDetectableScrollConditions(conditionsToReportScroll); + mDetector.setDetectableScrollConditions(directionsToDetectScroll, + ignoreSlopWhenSettling); } } if (mNoIntercept) { return false; } mDetector.onTouchEvent(ev); - if (mDetector.isScrollingState() && (isInDisallowRecatchBottomZone() || isInDisallowRecatchTopZone())) { + if (mDetector.isSettlingState() && (isInDisallowRecatchBottomZone() || isInDisallowRecatchTopZone())) { return false; } return mDetector.shouldIntercept(); @@ -132,7 +134,7 @@ public class AllAppsTransitionController implements TouchController, VerticalPul private boolean shouldPossiblyIntercept(MotionEvent ev) { DeviceProfile grid = mLauncher.getDeviceProfile(); - if (mDetector.isRestingState()) { + if (mDetector.isIdleState()) { if (grid.isVerticalBarLayout()) { if (ev.getY() > mLauncher.getDeviceProfile().heightPx - mBezelSwipeUpHeight) { return true; @@ -164,7 +166,7 @@ public class AllAppsTransitionController implements TouchController, VerticalPul } @Override - public void onScrollStart(boolean start) { + public void onDragStart(boolean start) { cancelAnimation(); mCurrentAnimation = LauncherAnimUtils.createAnimatorSet(); mShiftStart = mAppsView.getTranslationY(); @@ -172,7 +174,7 @@ public class AllAppsTransitionController implements TouchController, VerticalPul } @Override - public boolean onScroll(float displacement, float velocity) { + public boolean onDrag(float displacement, float velocity) { if (mAppsView == null) { return false; // early termination. } @@ -182,7 +184,7 @@ public class AllAppsTransitionController implements TouchController, VerticalPul } @Override - public void onScrollEnd(float velocity, boolean fling) { + public void onDragEnd(float velocity, boolean fling) { if (mAppsView == null) { return; // early termination. } @@ -229,7 +231,7 @@ public class AllAppsTransitionController implements TouchController, VerticalPul */ public void preparePull(boolean start) { if (start) { - // Initialize values that should not change until #onScrollEnd + // Initialize values that should not change until #onDragEnd mStatusBarHeight = mLauncher.getDragLayer().getInsets().top; mHotseat.setVisibility(View.VISIBLE); mHotseat.bringToFront(); @@ -321,7 +323,7 @@ public class AllAppsTransitionController implements TouchController, VerticalPul if (animationOut == null){ return; } - if (mDetector.isRestingState()) { + if (mDetector.isIdleState()) { preparePull(true); mAnimationDuration = duration; mShiftStart = mAppsView.getTranslationY(); @@ -361,7 +363,7 @@ public class AllAppsTransitionController implements TouchController, VerticalPul if (animationOut == null){ return; } - if(mDetector.isRestingState()) { + if(mDetector.isIdleState()) { preparePull(true); mAnimationDuration = duration; mShiftStart = mAppsView.getTranslationY(); |