Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 7cfd2c7d authored by Automerger Merge Worker's avatar Automerger Merge Worker
Browse files

Merge "Merge "SwipeHelper simplifications" into udc-qpr-dev am: 2cd923ca"...

Merge "Merge "SwipeHelper simplifications" into udc-qpr-dev am: 2cd923ca" into udc-qpr-dev-plus-aosp am: 92d2531c

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/23640279



Change-Id: I77d5227fe756293be01d5051528ff5054fc08d10
Signed-off-by: default avatarAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
parents a8821d84 92d2531c
Loading
Loading
Loading
Loading
+2 −12
Original line number Diff line number Diff line
@@ -81,9 +81,6 @@ public class SwipeHelper implements Gefingerpoken, Dumpable {

    protected final Handler mHandler;

    private float mMinSwipeProgress = 0f;
    private float mMaxSwipeProgress = 1f;

    private final SpringConfig mSnapBackSpringConfig =
            new SpringConfig(SpringForce.STIFFNESS_LOW, SpringForce.DAMPING_RATIO_LOW_BOUNCY);

@@ -227,18 +224,11 @@ public class SwipeHelper implements Gefingerpoken, Dumpable {
        return v.getMeasuredWidth();
    }

    public void setMinSwipeProgress(float minSwipeProgress) {
        mMinSwipeProgress = minSwipeProgress;
    }

    public void setMaxSwipeProgress(float maxSwipeProgress) {
        mMaxSwipeProgress = maxSwipeProgress;
    }

    private float getSwipeProgressForOffset(View view, float translation) {
        if (translation == 0) return 0;
        float viewSize = getSize(view);
        float result = Math.abs(translation / viewSize);
        return Math.min(Math.max(mMinSwipeProgress, result), mMaxSwipeProgress);
        return Math.min(Math.max(0, result), 1);
    }

    /**