From 83d10b402cf08070871b3dbc0ce112f6eebfe078 Mon Sep 17 00:00:00 2001 From: Jeff DeCew Date: Fri, 9 Jun 2023 14:45:20 -0400 Subject: [PATCH] SwipeHelper simplifications Bug: 259529672 Test: atest NotificationSwipeHelperTest Change-Id: Ic4ec04f38f9345d89965bd587f97868fbd6061c1 --- .../src/com/android/systemui/SwipeHelper.java | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) diff --git a/packages/SystemUI/src/com/android/systemui/SwipeHelper.java b/packages/SystemUI/src/com/android/systemui/SwipeHelper.java index 8af92ce4bcb11..c446ac47ad539 100644 --- a/packages/SystemUI/src/com/android/systemui/SwipeHelper.java +++ b/packages/SystemUI/src/com/android/systemui/SwipeHelper.java @@ -80,9 +80,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); @@ -226,18 +223,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); } /**