SetupWizard: Handle all touch events in EnableAccessibilityController
Change-Id: Icf15be21c90d32305a9c1f8b9835eb473acf1f33 (cherry picked from commit 0fde3a04cc62396b524aadb6a1a30f573a4b1b38)
This commit is contained in:
parent
e79aa7f0bf
commit
6d63e95342
@ -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());
|
||||
|
@ -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;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user