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

Commit 19be8c19 authored by Michael Bestas's avatar Michael Bestas Committed by Roman Birg
Browse files

Fix pattern visibility settings (1/2)

Change-Id: Ic627953c5df854c442671a98b5da539b994da18b
parent 8384c571
Loading
Loading
Loading
Loading
+6 −3
Original line number Original line Diff line number Diff line
@@ -1007,8 +1007,6 @@ public class LockPatternView extends View {
        // TODO: the path should be created and cached every time we hit-detect a cell
        // TODO: the path should be created and cached every time we hit-detect a cell
        // only the last segment of the path should be computed here
        // only the last segment of the path should be computed here
        // draw the path of the pattern (unless we are in stealth mode)
        // draw the path of the pattern (unless we are in stealth mode)
        // draw the path of the pattern (unless the user is in progress, and
        // we are in stealth mode)
        final boolean drawPath = ((!mInStealthMode && mPatternDisplayMode != DisplayMode.Wrong)
        final boolean drawPath = ((!mInStealthMode && mPatternDisplayMode != DisplayMode.Wrong)
                || (mPatternDisplayMode == DisplayMode.Wrong && mShowErrorPath));
                || (mPatternDisplayMode == DisplayMode.Wrong && mShowErrorPath));
        if (drawPath) {
        if (drawPath) {
@@ -1068,7 +1066,9 @@ public class LockPatternView extends View {
    }
    }


    private int getCurrentColor(boolean partOfPattern) {
    private int getCurrentColor(boolean partOfPattern) {
        if (!partOfPattern || mInStealthMode || mPatternInProgress) {
        if (!partOfPattern || (mInStealthMode && mPatternDisplayMode != DisplayMode.Wrong)
                || (mPatternDisplayMode == DisplayMode.Wrong && !mShowErrorPath)
                || mPatternInProgress) {
            // unselected circle
            // unselected circle
            return mRegularColor;
            return mRegularColor;
        } else if (mPatternDisplayMode == DisplayMode.Wrong) {
        } else if (mPatternDisplayMode == DisplayMode.Wrong) {
@@ -1087,6 +1087,9 @@ public class LockPatternView extends View {
     */
     */
    private void drawCircle(Canvas canvas, float centerX, float centerY, float size,
    private void drawCircle(Canvas canvas, float centerX, float centerY, float size,
            boolean partOfPattern, float alpha) {
            boolean partOfPattern, float alpha) {
        if (!mVisibleDots) {
            return;
        }
        mPaint.setColor(getCurrentColor(partOfPattern));
        mPaint.setColor(getCurrentColor(partOfPattern));
        mPaint.setAlpha((int) (alpha * 255));
        mPaint.setAlpha((int) (alpha * 255));
        canvas.drawCircle(centerX, centerY, size/2, mPaint);
        canvas.drawCircle(centerX, centerY, size/2, mPaint);