diff options
author | John Spurlock <jspurlock@google.com> | 2012-11-02 11:23:27 -0400 |
---|---|---|
committer | John Spurlock <jspurlock@google.com> | 2012-11-02 11:25:35 -0400 |
commit | 1ec464679f731827f626856084f19643fff64a94 (patch) | |
tree | d73139384611175f93def73257260206028a4bcd | |
parent | 79417e8912c6b91f55c4b7fd3bdd9b68b3a76abb (diff) | |
download | frameworks_base-1ec464679f731827f626856084f19643fff64a94.zip frameworks_base-1ec464679f731827f626856084f19643fff64a94.tar.gz frameworks_base-1ec464679f731827f626856084f19643fff64a94.tar.bz2 |
Block swipe up gesture if challenge non-interactive.
Change-Id: I0f9ba918c072261614011cd675e417e54296366f
-rw-r--r-- | policy/src/com/android/internal/policy/impl/keyguard/SlidingChallengeLayout.java | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/policy/src/com/android/internal/policy/impl/keyguard/SlidingChallengeLayout.java b/policy/src/com/android/internal/policy/impl/keyguard/SlidingChallengeLayout.java index fc12aa9..1f33fc3 100644 --- a/policy/src/com/android/internal/policy/impl/keyguard/SlidingChallengeLayout.java +++ b/policy/src/com/android/internal/policy/impl/keyguard/SlidingChallengeLayout.java @@ -122,6 +122,7 @@ public class SlidingChallengeLayout extends ViewGroup implements ChallengeLayout private final Rect mTempRect = new Rect(); private boolean mHasGlowpad; + private boolean mChallengeInteractive = true; static final Property<SlidingChallengeLayout, Float> HANDLE_ALPHA = new FloatProperty<SlidingChallengeLayout>("handleAlpha") { @@ -276,6 +277,7 @@ public class SlidingChallengeLayout extends ViewGroup implements ChallengeLayout } public void setChallengeInteractive(boolean interactive) { + mChallengeInteractive = interactive; if (mExpandChallengeView != null) { mExpandChallengeView.setEnabled(interactive); } @@ -585,7 +587,7 @@ public class SlidingChallengeLayout extends ViewGroup implements ChallengeLayout for (int i = 0; i < count; i++) { final float x = ev.getX(i); final float y = ev.getY(i); - if (!mIsBouncing && mActivePointerId == INVALID_POINTER + if (!mIsBouncing && mChallengeInteractive && mActivePointerId == INVALID_POINTER && (crossedDragHandle(x, y, mGestureStartY) || (isInChallengeView(x, y) && mScrollState == SCROLL_STATE_SETTLING))) { @@ -633,7 +635,7 @@ public class SlidingChallengeLayout extends ViewGroup implements ChallengeLayout break; case MotionEvent.ACTION_CANCEL: - if (mDragging) { + if (mDragging && mChallengeInteractive) { showChallenge(0); } resetTouch(); @@ -644,7 +646,7 @@ public class SlidingChallengeLayout extends ViewGroup implements ChallengeLayout break; } case MotionEvent.ACTION_UP: - if (mDragging) { + if (mDragging && mChallengeInteractive) { mVelocityTracker.computeCurrentVelocity(1000, mMaxVelocity); showChallenge((int) mVelocityTracker.getYVelocity(mActivePointerId)); } @@ -660,7 +662,8 @@ public class SlidingChallengeLayout extends ViewGroup implements ChallengeLayout if ((isInDragHandle(x, y) || crossedDragHandle(x, y, mGestureStartY) || (isInChallengeView(x, y) && mScrollState == SCROLL_STATE_SETTLING)) - && mActivePointerId == INVALID_POINTER) { + && mActivePointerId == INVALID_POINTER + && mChallengeInteractive) { mGestureStartX = x; mGestureStartY = y; mActivePointerId = ev.getPointerId(i); |