Kaydet (Commit) cb08fbbd authored tarafından Tomaž Vajngerl's avatar Tomaž Vajngerl Kaydeden (comit) Miklos Vajna

android: no need for MotionEvent when sending TOUCH LOEvent

Change-Id: I9173f50fb60680de1bb9744d3f351c44f8175d0c
üst 5fef3a0c
......@@ -29,7 +29,6 @@ public class LOEvent implements Comparable<LOEvent> {
public String mFilename;
public ComposedTileLayer mComposedTileLayer;
public String mTouchType;
public MotionEvent mMotionEvent;
public PointF mDocumentTouchCoordinate;
public KeyEvent mKeyEvent;
public RectF mInvalidationRect;
......@@ -62,11 +61,10 @@ public class LOEvent implements Comparable<LOEvent> {
mTypeString = "Thumbnail";
}
public LOEvent(int type, String touchType, MotionEvent motionEvent, PointF documentTouchCoordinate) {
public LOEvent(int type, String touchType, PointF documentTouchCoordinate) {
mType = type;
mTypeString = "Touch";
mTouchType = touchType;
mMotionEvent = motionEvent;
mDocumentTouchCoordinate = documentTouchCoordinate;
}
......
......@@ -86,8 +86,8 @@ public class LOKitShell {
/**
* Send touch event to LOKitThread.
*/
public static void sendTouchEvent(String touchType, MotionEvent motionEvent, PointF pointF) {
LOKitShell.sendEvent(new LOEvent(LOEvent.TOUCH, touchType, motionEvent, pointF));
public static void sendTouchEvent(String touchType, PointF documentTouchCoordinate) {
LOKitShell.sendEvent(new LOEvent(LOEvent.TOUCH, touchType, documentTouchCoordinate));
}
/**
......
......@@ -196,7 +196,7 @@ public class LOKitThread extends Thread {
createThumbnail(event.mTask);
break;
case LOEvent.TOUCH:
touch(event.mTouchType, event.mMotionEvent, event.mDocumentTouchCoordinate);
touch(event.mTouchType, event.mDocumentTouchCoordinate);
break;
case LOEvent.KEY_EVENT:
keyEvent(event.mKeyEvent);
......@@ -223,7 +223,7 @@ public class LOKitThread extends Thread {
/**
* Processes touch events.
*/
private void touch(String touchType, MotionEvent motionEvent, PointF mDocumentTouchCoordinate) {
private void touch(String touchType, PointF mDocumentTouchCoordinate) {
if (!LOKitShell.isEditingEnabled()) {
return;
}
......
......@@ -941,7 +941,7 @@ public class JavaPanZoomController
@Override
public void onLongPress(MotionEvent motionEvent) {
LOKitShell.sendTouchEvent("LongPress", motionEvent, getMotionInDocumentCoordinates(motionEvent));
LOKitShell.sendTouchEvent("LongPress", getMotionInDocumentCoordinates(motionEvent));
}
@Override
......@@ -949,7 +949,7 @@ public class JavaPanZoomController
// When double-tapping is allowed, we have to wait to see if this is
// going to be a double-tap.
if (!mWaitForDoubleTap) {
LOKitShell.sendTouchEvent("SingleTap", motionEvent, getMotionInDocumentCoordinates(motionEvent));
LOKitShell.sendTouchEvent("SingleTap", getMotionInDocumentCoordinates(motionEvent));
}
// return false because we still want to get the ACTION_UP event that triggers this
return false;
......@@ -959,14 +959,14 @@ public class JavaPanZoomController
public boolean onSingleTapConfirmed(MotionEvent motionEvent) {
// In cases where we don't wait for double-tap, we handle this in onSingleTapUp.
if (mWaitForDoubleTap) {
LOKitShell.sendTouchEvent("SingleTap", motionEvent, getMotionInDocumentCoordinates(motionEvent));
LOKitShell.sendTouchEvent("SingleTap", getMotionInDocumentCoordinates(motionEvent));
}
return true;
}
@Override
public boolean onDoubleTap(MotionEvent motionEvent) {
LOKitShell.sendTouchEvent("DoubleTap", motionEvent, getMotionInDocumentCoordinates(motionEvent));
LOKitShell.sendTouchEvent("DoubleTap", getMotionInDocumentCoordinates(motionEvent));
return true;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment