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

Commit 158af6a0 authored by Selim Cinek's avatar Selim Cinek
Browse files

Fixed keyguard affordances

In certain cases, the keyguard affordances could not be launched
due to a bug. This was because the targetedView was not properly
reset sometimes.

Bug: 22013726
Change-Id: I4525dc5adf07f4d023ef8553d3db0b16c8f754c4
parent d06c41c9
Loading
Loading
Loading
Loading
+2 −19
Original line number Diff line number Diff line
@@ -68,26 +68,12 @@ public class KeyguardAffordanceHelper {
    private View mTargetedView;
    private boolean mTouchSlopExeeded;
    private AnimatorListenerAdapter mFlingEndListener = new AnimatorListenerAdapter() {
        public boolean mCancelled;

        @Override
        public void onAnimationEnd(Animator animation) {
            mSwipeAnimator = null;
            mSwipingInProgress = false;
            if (!mCancelled) {
            mTargetedView = null;
        }
        }

        @Override
        public void onAnimationCancel(Animator animation) {
            mCancelled = true;
        }

        @Override
        public void onAnimationStart(Animator animation) {
            mCancelled = false;
        }
    };
    private Runnable mAnimationEndRunnable = new Runnable() {
        @Override
@@ -290,7 +276,6 @@ public class KeyguardAffordanceHelper {
     * Phase 2: Move back.
     */
    private void startUnlockHintAnimationPhase2(boolean right, final Runnable onFinishedListener) {
        final KeyguardAffordanceView targetView = right ? mRightIcon : mLeftIcon;
        ValueAnimator animator = getAnimatorToRadius(right, 0);
        animator.addListener(new AnimatorListenerAdapter() {
            @Override
@@ -513,9 +498,7 @@ public class KeyguardAffordanceHelper {
    }

    public void reset(boolean animate) {
        if (mSwipeAnimator != null) {
            mSwipeAnimator.cancel();
        }
        cancelAnimation();
        setTranslation(0.0f, true, animate);
        mMotionCancelled = true;
        if (mSwipingInProgress) {