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

Commit 67c5713e authored by Danesh's avatar Danesh Committed by Danesh Mondegarian
Browse files

RingLockscreen : Fix animation delay

The unlock/custom app animation for some people (including me)
was not being shown, it would just straight unlock/launch custom app.

This addresses that issue.

Change-Id: Ib41c0fd7409a610b2ab415d40a5c1508ad67d305
parent cc60c9a2
Loading
Loading
Loading
Loading
+8 −10
Original line number Diff line number Diff line
@@ -87,7 +87,7 @@ public class RingSelector extends ViewGroup {
     * Either {@link #HORIZONTAL} or {@link #VERTICAL}.
     */
    private int mOrientation;

    private int mSelectedRingId;
    private Ring mLeftRing;
    private Ring mRightRing;
    private Ring mMiddleRing;
@@ -889,7 +889,7 @@ public class RingSelector extends ViewGroup {
                    }
                    break;
                case MotionEvent.ACTION_UP:
                    int secIdx = -1;
                    mSelectedRingId = -1;
                    boolean thresholdReached = false;

                    if (mCurrentRing != mMiddleRing) {
@@ -901,7 +901,7 @@ public class RingSelector extends ViewGroup {
                        for (int q = 0; q < 4; q++) {
                            if (!mSecRings[q].isHidden() && mSecRings[q].contains((int) x, (int) y)) {
                                thresholdReached = true;
                                secIdx = q;
                                mSelectedRingId = q;
                                break;
                            }
                        }
@@ -911,14 +911,7 @@ public class RingSelector extends ViewGroup {
                        mTriggered = true;
                        mTracking = false;
                        mCurrentRing.setState(Ring.STATE_ACTIVE);

                        boolean isLeft = mCurrentRing == mLeftRing;
                        boolean isRight = mCurrentRing == mRightRing;
                        dispatchTriggerEvent(isLeft ?
                            OnRingTriggerListener.LEFT_RING : (isRight ? OnRingTriggerListener.RIGHT_RING :
                                OnRingTriggerListener.MIDDLE_RING), secIdx);
                        startAnimating();

                        setGrabbedState(OnRingTriggerListener.NO_RING);
                        setKeepScreenOn(false);
                        break;
@@ -975,6 +968,11 @@ public class RingSelector extends ViewGroup {
    }

    private void onAnimationDone() {
        boolean isLeft = mCurrentRing == mLeftRing;
        boolean isRight = mCurrentRing == mRightRing;
        dispatchTriggerEvent(isLeft ?
                OnRingTriggerListener.LEFT_RING : (isRight ? OnRingTriggerListener.RIGHT_RING :
                    OnRingTriggerListener.MIDDLE_RING), mSelectedRingId);
        resetView();
        mAnimating = false;
    }