diff options
author | cretin45 <cretin45@gmail.com> | 2015-04-08 12:09:55 -0700 |
---|---|---|
committer | Ed Carrigan <cretin45@gmail.com> | 2015-04-09 20:34:18 +0000 |
commit | 6d63e953423958f96fbe32bad03808e178ca5604 (patch) | |
tree | b350a62fcce0cf9611cf24fdf0810fd0199d1045 | |
parent | e79aa7f0bfd431eea2dddbe4be7fb0fd9ba39ee7 (diff) | |
download | packages_apps_SetupWizard-6d63e953423958f96fbe32bad03808e178ca5604.zip packages_apps_SetupWizard-6d63e953423958f96fbe32bad03808e178ca5604.tar.gz packages_apps_SetupWizard-6d63e953423958f96fbe32bad03808e178ca5604.tar.bz2 |
SetupWizard: Handle all touch events in EnableAccessibilityController
Change-Id: Icf15be21c90d32305a9c1f8b9835eb473acf1f33
(cherry picked from commit 0fde3a04cc62396b524aadb6a1a30f573a4b1b38)
-rw-r--r-- | src/com/cyanogenmod/setupwizard/ui/SetupWizardActivity.java | 4 | ||||
-rw-r--r-- | src/com/cyanogenmod/setupwizard/util/EnableAccessibilityController.java | 20 |
2 files changed, 17 insertions, 7 deletions
diff --git a/src/com/cyanogenmod/setupwizard/ui/SetupWizardActivity.java b/src/com/cyanogenmod/setupwizard/ui/SetupWizardActivity.java index ae9dd34..65a9806 100644 --- a/src/com/cyanogenmod/setupwizard/ui/SetupWizardActivity.java +++ b/src/com/cyanogenmod/setupwizard/ui/SetupWizardActivity.java @@ -124,7 +124,9 @@ public class SetupWizardActivity extends Activity implements SetupDataCallbacks, mRootView.setOnTouchListener(new View.OnTouchListener() { @Override public boolean onTouch(View v, MotionEvent event) { - return mEnableAccessibilityController.onInterceptTouchEvent(event); + return + mEnableAccessibilityController.onInterceptTouchEvent(event) & + mEnableAccessibilityController.onTouchEvent(event); } }); registerReceiver(mSetupData, mSetupData.getIntentFilter()); diff --git a/src/com/cyanogenmod/setupwizard/util/EnableAccessibilityController.java b/src/com/cyanogenmod/setupwizard/util/EnableAccessibilityController.java index 8311058..0af4cd7 100644 --- a/src/com/cyanogenmod/setupwizard/util/EnableAccessibilityController.java +++ b/src/com/cyanogenmod/setupwizard/util/EnableAccessibilityController.java @@ -130,7 +130,7 @@ public class EnableAccessibilityController { // accessibility service, then we have nothing to do. if (accessibilityManager.isEnabled() && !accessibilityManager.getEnabledAccessibilityServiceList( - AccessibilityServiceInfo.FEEDBACK_SPOKEN).isEmpty()) { + AccessibilityServiceInfo.FEEDBACK_SPOKEN).isEmpty()) { return false; } @@ -168,7 +168,7 @@ public class EnableAccessibilityController { mHandler.sendEmptyMessageDelayed(MESSAGE_SPEAK_WARNING, SPEAK_WARNING_DELAY_MILLIS); mHandler.sendEmptyMessageDelayed(MESSAGE_ENABLE_ACCESSIBILITY, - ENABLE_ACCESSIBILITY_DELAY_MILLIS); + ENABLE_ACCESSIBILITY_DELAY_MILLIS); return true; } return false; @@ -188,8 +188,14 @@ public class EnableAccessibilityController { if (pointerCount > 2) { cancel(); } - } break; + } + break; case MotionEvent.ACTION_MOVE: { + //We only care about a 2 fingered move + if (pointerCount < 2) { + cancel(); + return false; + } final float firstPointerMove = MathUtils.dist(event.getX(0), event.getY(0), mFirstPointerDownX, mFirstPointerDownY); if (Math.abs(firstPointerMove) > mTouchSlop) { @@ -200,11 +206,13 @@ public class EnableAccessibilityController { if (Math.abs(secondPointerMove) > mTouchSlop) { cancel(); } - } break; + } + break; case MotionEvent.ACTION_POINTER_UP: case MotionEvent.ACTION_CANCEL: { cancel(); - } break; + } + break; } return true; } @@ -287,4 +295,4 @@ public class EnableAccessibilityController { } } } -}
\ No newline at end of file +} |