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

Commit bc0c3437 authored by Dhina17's avatar Dhina17 Committed by Bruno Martins
Browse files

LockPatternView: Fix showing pattern error

Currently, Pattern animation is getting stuck on wrong pattern
when "show pattern error" enabled.

This commit fixes this issue and show the wrong pattern and dots
with error color correctly.

Change-Id: I4c9962f752b92858de2f2193d98343723164eac7
parent b46d0a66
Loading
Loading
Loading
Loading
+4 −2
Original line number Diff line number Diff line
@@ -1339,7 +1339,8 @@ public class LockPatternView extends View {
    private void drawLineSegment(Canvas canvas, float startX, float startY, float endX, float endY,
            long lineFadeStart, long elapsedRealtime) {
        float fadeAwayProgress;
        if (mFadePattern) {
        final boolean drawWrongPath = mPatternDisplayMode == DisplayMode.Wrong && mShowErrorPath;
        if (mFadePattern && !drawWrongPath) {
            if (elapsedRealtime - lineFadeStart
                    >= mLineFadeOutAnimationDelayMs + mLineFadeOutAnimationDurationMs) {
                // Time for this segment animation is out so we don't need to draw it.
@@ -1433,7 +1434,8 @@ public class LockPatternView extends View {
     */
    private void drawCircle(Canvas canvas, float centerX, float centerY, float radius,
            boolean partOfPattern, float alpha, float activationAnimationProgress) {
        if (mFadePattern && !mInStealthMode) {
        final boolean drawWrongPath = mPatternDisplayMode == DisplayMode.Wrong && mShowErrorPath;
        if (mFadePattern && !mInStealthMode && !drawWrongPath) {
            int resultColor = ColorUtils.blendARGB(mDotColor, mDotActivatedColor,
                    /* ratio= */ activationAnimationProgress);
            mPaint.setColor(resultColor);