summaryrefslogtreecommitdiffstats
path: root/packages/SystemUI/src/com/android/systemui/SwipeHelper.java
diff options
context:
space:
mode:
authord34d <clark@cyngn.com>2016-04-15 16:26:36 -0700
committerGerrit Code Review <gerrit@cyanogenmod.org>2016-04-15 17:03:49 -0700
commitd3ed55caea26d293dd9c812aaf5963eb58360e8f (patch)
treef47315e410d4327067047182d3a363f2076a7bc9 /packages/SystemUI/src/com/android/systemui/SwipeHelper.java
parent2c35c469fa343b499b55dddc37cd77d4ac0e26c5 (diff)
downloadframeworks_base-d3ed55caea26d293dd9c812aaf5963eb58360e8f.zip
frameworks_base-d3ed55caea26d293dd9c812aaf5963eb58360e8f.tar.gz
frameworks_base-d3ed55caea26d293dd9c812aaf5963eb58360e8f.tar.bz2
SysUI: Fix reporting of swipe progess in notification panel
SwipHelper only uses half of the child views width for determining swip progress. This patch adds a new member variable that can be changed via a setter. The default is the constant value that was used prior to this patch so that it does not affect notifications that also use the SwipeHelper. Change-Id: Ie19ab812bed2248dbc842294a8dc4b5f6520efb8 TICKET: CYNGNOS-2485
Diffstat (limited to 'packages/SystemUI/src/com/android/systemui/SwipeHelper.java')
-rw-r--r--packages/SystemUI/src/com/android/systemui/SwipeHelper.java9
1 files changed, 8 insertions, 1 deletions
diff --git a/packages/SystemUI/src/com/android/systemui/SwipeHelper.java b/packages/SystemUI/src/com/android/systemui/SwipeHelper.java
index 23e9d8a..c3e5043 100644
--- a/packages/SystemUI/src/com/android/systemui/SwipeHelper.java
+++ b/packages/SystemUI/src/com/android/systemui/SwipeHelper.java
@@ -91,6 +91,8 @@ public class SwipeHelper implements Gefingerpoken {
private int mFalsingThreshold;
private boolean mTouchAboveFalsingThreshold;
+ private float mSwipeProgressFadeEnd;
+
public SwipeHelper(int swipeDirection, Callback callback, Context context) {
mCallback = callback;
mHandler = new Handler();
@@ -110,6 +112,7 @@ public class SwipeHelper implements Gefingerpoken {
} else {
mSwipeZone = SWIPE_ZONE_TOP | SWIPE_ZONE_BOTTOM;
}
+ mSwipeProgressFadeEnd = SWIPE_PROGRESS_FADE_END;
}
public SwipeHelper(int swipeDirection, int swipeZone, Callback callback, Context context) {
@@ -184,7 +187,7 @@ public class SwipeHelper implements Gefingerpoken {
private float getSwipeProgressForOffset(View view) {
float viewSize = getSize(view);
- final float fadeSize = SWIPE_PROGRESS_FADE_END * viewSize;
+ final float fadeSize = mSwipeProgressFadeEnd * viewSize;
float result = 1.0f;
float pos = getTranslation(view);
if (pos >= viewSize * SWIPE_PROGRESS_FADE_START) {
@@ -516,6 +519,10 @@ public class SwipeHelper implements Gefingerpoken {
return true;
}
+ public void setSwipeProgressFadeEnd(float end) {
+ mSwipeProgressFadeEnd = end;
+ }
+
private int getFalsingThreshold() {
float factor = mCallback.getFalsingThresholdFactor();
return (int) (mFalsingThreshold * factor);