summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLuK1337 <priv.luk@gmail.com>2019-09-29 16:11:43 (GMT)
committerƁukasz Patron <priv.luk@gmail.com>2019-11-27 14:51:56 (GMT)
commit7ef25210cbc5c2fae76776ee3d0fdcddf1995071 (patch)
tree81c246bd01a52a155c09a94b87767e3c8dd071d2
parent81317f24fd8839370bcce1ecf47ef18f93f932f5 (diff)
downloadframeworks_base-7ef25210cbc5c2fae76776ee3d0fdcddf1995071.zip
frameworks_base-7ef25210cbc5c2fae76776ee3d0fdcddf1995071.tar.gz
frameworks_base-7ef25210cbc5c2fae76776ee3d0fdcddf1995071.tar.bz2
Fix "show pattern error" feature
Change-Id: I729c2672052308d6adeb4460420bf4cd93a37156
-rw-r--r--core/java/com/android/internal/widget/LockPatternView.java14
1 files changed, 5 insertions, 9 deletions
diff --git a/core/java/com/android/internal/widget/LockPatternView.java b/core/java/com/android/internal/widget/LockPatternView.java
index 7eb71fa..5a1d06c 100644
--- a/core/java/com/android/internal/widget/LockPatternView.java
+++ b/core/java/com/android/internal/widget/LockPatternView.java
@@ -1062,11 +1062,6 @@ public class LockPatternView extends View {
setPatternInProgress(false);
cancelLineAnimations();
notifyPatternDetected();
- // Also clear pattern if fading is enabled
- if (mFadePattern) {
- clearPatternDrawLookup();
- mPatternDisplayMode = DisplayMode.Correct;
- }
invalidate();
}
if (PROFILE_DRAWING) {
@@ -1209,8 +1204,9 @@ public class LockPatternView extends View {
// 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
// draw the path of the pattern (unless we are in stealth mode)
- final boolean drawPath = ((!mInStealthMode && mPatternDisplayMode != DisplayMode.Wrong)
- || (mPatternDisplayMode == DisplayMode.Wrong && mShowErrorPath));
+ final boolean drawWrongPath = mPatternDisplayMode == DisplayMode.Wrong && mShowErrorPath;
+ final boolean drawPath = (!mInStealthMode && mPatternDisplayMode != DisplayMode.Wrong)
+ || drawWrongPath;
if (drawPath) {
mPathPaint.setColor(getCurrentColor(true /* partOfPattern */));
@@ -1246,14 +1242,14 @@ public class LockPatternView extends View {
currentPath.moveTo(lastX, lastY);
if (state.lineEndX != Float.MIN_VALUE && state.lineEndY != Float.MIN_VALUE) {
currentPath.lineTo(state.lineEndX, state.lineEndY);
- if (mFadePattern) {
+ if (mFadePattern && !drawWrongPath) {
mPathPaint.setAlpha((int) 255 - lineFadeVal );
} else {
mPathPaint.setAlpha(255);
}
} else {
currentPath.lineTo(centerX, centerY);
- if (mFadePattern) {
+ if (mFadePattern && !drawWrongPath) {
mPathPaint.setAlpha((int) 255 - lineFadeVal );
} else {
mPathPaint.setAlpha(255);