summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/com/cyanogenmod/setupwizard/ui/SetupWizardActivity.java4
-rw-r--r--src/com/cyanogenmod/setupwizard/util/EnableAccessibilityController.java20
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
+}