summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJim Miller <jaggies@google.com>2013-09-20 14:21:50 -0700
committerJim Miller <jaggies@google.com>2013-09-24 14:46:50 -0700
commit8de9e443d85df22d93898bf92cb612553313aecc (patch)
treed1c937b46a14b6655d6fc0ba86c8980c32c320e6
parent5f86b90b8a224e21db89bacf78d4bd4d3f44342d (diff)
downloadframeworks_base-8de9e443d85df22d93898bf92cb612553313aecc.zip
frameworks_base-8de9e443d85df22d93898bf92cb612553313aecc.tar.gz
frameworks_base-8de9e443d85df22d93898bf92cb612553313aecc.tar.bz2
Fit and finish for navbar camera affordance
- fix potential event dispatch bug where camera events weren't always propagated - fix DelegateViewHelper to always propagate events, even when disabled Bug 10332383 Change-Id: Ie082d3074fc6497ee3633dcc0a51a6b08bcf0037
-rw-r--r--packages/Keyguard/src/com/android/keyguard/KeyguardWidgetPager.java7
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/DelegateViewHelper.java5
2 files changed, 8 insertions, 4 deletions
diff --git a/packages/Keyguard/src/com/android/keyguard/KeyguardWidgetPager.java b/packages/Keyguard/src/com/android/keyguard/KeyguardWidgetPager.java
index f7dc058..f8857ab 100644
--- a/packages/Keyguard/src/com/android/keyguard/KeyguardWidgetPager.java
+++ b/packages/Keyguard/src/com/android/keyguard/KeyguardWidgetPager.java
@@ -90,6 +90,7 @@ public class KeyguardWidgetPager extends PagedView implements PagedView.PageSwit
// Background worker thread: used here for persistence, also made available to widget frames
private final HandlerThread mBackgroundWorkerThread;
private final Handler mBackgroundWorkerHandler;
+ private boolean mCameraEventInProgress;
public KeyguardWidgetPager(Context context, AttributeSet attrs) {
this(context, attrs, 0);
@@ -941,14 +942,18 @@ public class KeyguardWidgetPager extends PagedView implements PagedView.PageSwit
beginCameraEvent();
int cameraPage = getPageCount() - 1;
boolean endWarp = false;
- if (isCameraPage(cameraPage)) {
+ if (isCameraPage(cameraPage) || mCameraEventInProgress) {
switch (event.getAction()) {
case MotionEvent.ACTION_DOWN:
+ // Once we start dispatching camera events, we must continue to do so
+ // to keep event dispatch happy.
+ mCameraEventInProgress = true;
userActivity();
startWarp(cameraPage);
break;
case MotionEvent.ACTION_UP:
case MotionEvent.ACTION_CANCEL:
+ mCameraEventInProgress = false;
endWarp = true;
break;
}
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/DelegateViewHelper.java b/packages/SystemUI/src/com/android/systemui/statusbar/DelegateViewHelper.java
index 3a5524d..3a82753 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/DelegateViewHelper.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/DelegateViewHelper.java
@@ -50,8 +50,7 @@ public class DelegateViewHelper {
}
public boolean onInterceptTouchEvent(MotionEvent event) {
- if (mSourceView == null || mDelegateView == null || mDisabled
- || mBar.shouldDisableNavbarGestures()) {
+ if (mSourceView == null || mDelegateView == null || mBar.shouldDisableNavbarGestures()) {
return false;
}
@@ -73,7 +72,7 @@ public class DelegateViewHelper {
return false;
}
- if (!mPanelShowing && action == MotionEvent.ACTION_MOVE) {
+ if (!mDisabled && !mPanelShowing && action == MotionEvent.ACTION_MOVE) {
final int historySize = event.getHistorySize();
for (int k = 0; k < historySize + 1; k++) {
float x = k < historySize ? event.getHistoricalX(k) : event.getX();