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

Commit d3ed55ca authored by d34d's avatar d34d Committed by Gerrit Code Review
Browse files

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
parent 2c35c469
Loading
Loading
Loading
Loading
+8 −1
Original line number Diff line number Diff line
@@ -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);
+1 −0
Original line number Diff line number Diff line
@@ -379,6 +379,7 @@ public class NotificationPanelView extends PanelView implements

        mSwipeHelper = new SwipeHelper(SwipeHelper.X,
                SwipeHelper.SWIPE_ZONE_LEFT, mSwipeCallback, mContext);
        mSwipeHelper.setSwipeProgressFadeEnd(1.0f);
        mMinimumFlingVelocity = ViewConfiguration.get(getContext())
                .getScaledMinimumFlingVelocity();