summaryrefslogtreecommitdiff
path: root/android
diff options
context:
space:
mode:
authorTomaž Vajngerl <tomaz.vajngerl@collabora.co.uk>2015-01-23 23:58:28 +0900
committerMiklos Vajna <vmiklos@collabora.co.uk>2015-01-26 10:27:45 +0100
commit525d73fc41bdb8afe227d6207e1f5d6df27ca24b (patch)
tree55060f4cd5339f5d05d64550bb4118da74c1519c /android
parent41e5824de88d9caa62612a8ca7265014635fb3de (diff)
android: extend touch event with transformed document coordinate
Change-Id: I17e48bd39b799dc41b8d0402652f70d33ba002d7
Diffstat (limited to 'android')
-rw-r--r--android/experimental/LOAndroid3/src/java/org/libreoffice/LOEvent.java5
-rw-r--r--android/experimental/LOAndroid3/src/java/org/libreoffice/LOKitShell.java5
-rw-r--r--android/experimental/LOAndroid3/src/java/org/libreoffice/LOKitThread.java4
3 files changed, 9 insertions, 5 deletions
diff --git a/android/experimental/LOAndroid3/src/java/org/libreoffice/LOEvent.java b/android/experimental/LOAndroid3/src/java/org/libreoffice/LOEvent.java
index 809988d215d0..11bd72d511e7 100644
--- a/android/experimental/LOAndroid3/src/java/org/libreoffice/LOEvent.java
+++ b/android/experimental/LOAndroid3/src/java/org/libreoffice/LOEvent.java
@@ -1,5 +1,6 @@
package org.libreoffice;
+import android.graphics.PointF;
import android.view.KeyEvent;
import android.view.MotionEvent;
@@ -33,6 +34,7 @@ public class LOEvent implements Comparable<LOEvent> {
public SubTile mTile;
public String mTouchType;
public MotionEvent mMotionEvent;
+ public PointF mDocumentTouchCoordinate;
public KeyEvent mKeyEvent;
public LOEvent(int type) {
@@ -81,11 +83,12 @@ public class LOEvent implements Comparable<LOEvent> {
mTile = tile;
}
- public LOEvent(int type, String touchType, MotionEvent motionEvent) {
+ public LOEvent(int type, String touchType, MotionEvent motionEvent, PointF documentTouchCoordinate) {
mType = type;
mTypeString = "Touch";
mTouchType = touchType;
mMotionEvent = motionEvent;
+ mDocumentTouchCoordinate = documentTouchCoordinate;
}
public LOEvent(int type, KeyEvent keyEvent) {
diff --git a/android/experimental/LOAndroid3/src/java/org/libreoffice/LOKitShell.java b/android/experimental/LOAndroid3/src/java/org/libreoffice/LOKitShell.java
index 49da6b42d7b2..0f606edff56d 100644
--- a/android/experimental/LOAndroid3/src/java/org/libreoffice/LOKitShell.java
+++ b/android/experimental/LOAndroid3/src/java/org/libreoffice/LOKitShell.java
@@ -3,6 +3,7 @@ package org.libreoffice;
import android.app.ActivityManager;
import android.content.Context;
+import android.graphics.PointF;
import android.os.Handler;
import android.util.DisplayMetrics;
import android.view.KeyEvent;
@@ -72,8 +73,8 @@ public class LOKitShell {
/**
* Send touch event to LOKitThread.
*/
- public static void sentTouchEvent(String touchType, MotionEvent motionEvent) {
- LOKitShell.sendEvent(new LOEvent(LOEvent.TOUCH, "SingleTap", motionEvent));
+ public static void sentTouchEvent(String touchType, MotionEvent motionEvent, PointF pointF) {
+ LOKitShell.sendEvent(new LOEvent(LOEvent.TOUCH, "SingleTap", motionEvent, pointF));
}
/**
diff --git a/android/experimental/LOAndroid3/src/java/org/libreoffice/LOKitThread.java b/android/experimental/LOAndroid3/src/java/org/libreoffice/LOKitThread.java
index fd88f1c1fb7f..f274cf397d06 100644
--- a/android/experimental/LOAndroid3/src/java/org/libreoffice/LOKitThread.java
+++ b/android/experimental/LOAndroid3/src/java/org/libreoffice/LOKitThread.java
@@ -151,7 +151,7 @@ public class LOKitThread extends Thread implements TileProvider.TileInvalidation
if (!LOKitShell.isEditingEnabled()) {
return;
}
- touch(event.mTouchType, event.mMotionEvent);
+ touch(event.mTouchType, event.mMotionEvent, event.mDocumentTouchCoordinate);
break;
case LOEvent.KEY_PRESS:
if (!LOKitShell.isEditingEnabled()) {
@@ -162,7 +162,7 @@ public class LOKitThread extends Thread implements TileProvider.TileInvalidation
}
}
- private void touch(String touchType, MotionEvent motionEvent) {
+ private void touch(String touchType, MotionEvent motionEvent, PointF mDocumentTouchCoordinate) {
LibreOfficeMainActivity.mAppContext.showSoftKeyboard();
}