Bug 1251370 - Allow all non-touchpad scroll events on Android - r=kats

This commit is contained in:
Edwin Flores 2016-03-17 11:54:55 +00:00
parent 5c6854ad0e
commit ef62134a97

View File

@ -21,6 +21,7 @@ import android.util.TypedValue;
import android.view.KeyEvent;
import android.view.MotionEvent;
import android.view.View;
import android.view.InputDevice;
class NativePanZoomController extends JNIObject implements PanZoomController {
private final PanZoomTarget mTarget;
@ -171,8 +172,12 @@ class NativePanZoomController extends JNIObject implements PanZoomController {
@Override
public boolean onMotionEvent(MotionEvent event) {
final int action = event.getActionMasked();
if (action == MotionEvent.ACTION_SCROLL && event.getDownTime() >= mLastDownTime) {
mLastDownTime = event.getDownTime();
if (action == MotionEvent.ACTION_SCROLL) {
if (event.getDownTime() >= mLastDownTime) {
mLastDownTime = event.getDownTime();
} else if ((InputDevice.getDevice(event.getDeviceId()).getSources() & InputDevice.SOURCE_TOUCHPAD) == InputDevice.SOURCE_TOUCHPAD) {
return false;
}
return handleScrollEvent(event);
} else if ((action == MotionEvent.ACTION_HOVER_MOVE) ||
(action == MotionEvent.ACTION_HOVER_ENTER) ||