mirror of
https://github.com/LawnchairLauncher/lawnchair.git
synced 2026-03-03 09:26:51 +00:00
Make AllApps bottom sheet follow finger and snap after 30% progress
Bug: 220336617 Test: manual Change-Id: I0b6296cf5abf0f0a5f34fc2a0b5be93dc93ebf3f
This commit is contained in:
@@ -17,6 +17,8 @@ package com.android.launcher3.views;
|
||||
|
||||
import static android.view.ViewGroup.LayoutParams.MATCH_PARENT;
|
||||
|
||||
import static com.android.launcher3.LauncherAnimUtils.SUCCESS_TRANSITION_PROGRESS;
|
||||
import static com.android.launcher3.LauncherAnimUtils.TABLET_BOTTOM_SHEET_SUCCESS_TRANSITION_PROGRESS;
|
||||
import static com.android.launcher3.anim.Interpolators.scrollInterpolatorForVelocity;
|
||||
|
||||
import android.animation.Animator;
|
||||
@@ -184,7 +186,10 @@ public abstract class AbstractSlideInView<T extends Context & ActivityContext>
|
||||
|
||||
@Override
|
||||
public void onDragEnd(float velocity) {
|
||||
if ((mSwipeDetector.isFling(velocity) && velocity > 0) || mTranslationShift > 0.5f) {
|
||||
float successfulShiftThreshold = mActivityContext.getDeviceProfile().isTablet
|
||||
? TABLET_BOTTOM_SHEET_SUCCESS_TRANSITION_PROGRESS : SUCCESS_TRANSITION_PROGRESS;
|
||||
if ((mSwipeDetector.isFling(velocity) && velocity > 0)
|
||||
|| mTranslationShift > successfulShiftThreshold) {
|
||||
mScrollInterpolator = scrollInterpolatorForVelocity(velocity);
|
||||
mOpenCloseAnimator.setDuration(BaseSwipeDetector.calculateDuration(
|
||||
velocity, TRANSLATION_SHIFT_CLOSED - mTranslationShift));
|
||||
|
||||
Reference in New Issue
Block a user