Loading core/java/com/android/internal/widget/LockPatternView.java +19 −2 Original line number Diff line number Diff line Loading @@ -125,6 +125,7 @@ public class LockPatternView extends View { private boolean mInStealthMode = false; private boolean mEnableHapticFeedback = true; private boolean mPatternInProgress = false; private boolean mFadePattern = true; private float mHitFactor = 0.6f; Loading Loading @@ -375,6 +376,14 @@ public class LockPatternView extends View { mInStealthMode = inStealthMode; } /** * Set whether the pattern should fade as it's being drawn. If * true, each segment of the pattern fades over time. */ public void setFadePattern(boolean fadePattern) { mFadePattern = fadePattern; } /** * Set whether the view will use tactile feedback. If true, there will be * tactile feedback as the user enters the pattern. Loading Loading @@ -1167,10 +1176,18 @@ 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) { mPathPaint.setAlpha((int) 255 - lineFadeVal ); } else { mPathPaint.setAlpha(255); } } else { currentPath.lineTo(centerX, centerY); if (mFadePattern) { mPathPaint.setAlpha((int) 255 - lineFadeVal ); } else { mPathPaint.setAlpha(255); } } canvas.drawPath(currentPath, mPathPaint); } Loading Loading
core/java/com/android/internal/widget/LockPatternView.java +19 −2 Original line number Diff line number Diff line Loading @@ -125,6 +125,7 @@ public class LockPatternView extends View { private boolean mInStealthMode = false; private boolean mEnableHapticFeedback = true; private boolean mPatternInProgress = false; private boolean mFadePattern = true; private float mHitFactor = 0.6f; Loading Loading @@ -375,6 +376,14 @@ public class LockPatternView extends View { mInStealthMode = inStealthMode; } /** * Set whether the pattern should fade as it's being drawn. If * true, each segment of the pattern fades over time. */ public void setFadePattern(boolean fadePattern) { mFadePattern = fadePattern; } /** * Set whether the view will use tactile feedback. If true, there will be * tactile feedback as the user enters the pattern. Loading Loading @@ -1167,10 +1176,18 @@ 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) { mPathPaint.setAlpha((int) 255 - lineFadeVal ); } else { mPathPaint.setAlpha(255); } } else { currentPath.lineTo(centerX, centerY); if (mFadePattern) { mPathPaint.setAlpha((int) 255 - lineFadeVal ); } else { mPathPaint.setAlpha(255); } } canvas.drawPath(currentPath, mPathPaint); } Loading