summaryrefslogtreecommitdiff
path: root/android
diff options
context:
space:
mode:
authorTomaž Vajngerl <tomaz.vajngerl@collabora.co.uk>2015-02-26 18:55:34 +0900
committerMiklos Vajna <vmiklos@collabora.co.uk>2015-03-02 08:50:58 +0100
commitb2753b46665bf9b51fd2870e5894dd6d924a7d8c (patch)
tree26c52da411a20fdbc0107dd1a88b4ddc6969e8d7 /android
parented42840dfb61899edde5e88373904c34a59a55c6 (diff)
android: connect the selection change LOEvent with TileProvider
Change-Id: Ic0b499fcafb56fd5cff6559b66a1698992c1c6ed
Diffstat (limited to 'android')
-rw-r--r--android/experimental/LOAndroid3/src/java/org/libreoffice/LOKitThread.java17
1 files changed, 17 insertions, 0 deletions
diff --git a/android/experimental/LOAndroid3/src/java/org/libreoffice/LOKitThread.java b/android/experimental/LOAndroid3/src/java/org/libreoffice/LOKitThread.java
index 295d982139af..fc576c6b48fe 100644
--- a/android/experimental/LOAndroid3/src/java/org/libreoffice/LOKitThread.java
+++ b/android/experimental/LOAndroid3/src/java/org/libreoffice/LOKitThread.java
@@ -7,6 +7,7 @@ import android.util.Log;
import android.view.KeyEvent;
import android.view.MotionEvent;
+import org.mozilla.gecko.TextSelectionHandle;
import org.mozilla.gecko.gfx.CairoImage;
import org.mozilla.gecko.gfx.ComposedTileLayer;
import org.mozilla.gecko.gfx.GeckoLayerClient;
@@ -204,6 +205,22 @@ public class LOKitThread extends Thread {
case LOEvent.TILE_REEVALUATION_REQUEST:
tileReevaluationRequest(event.mComposedTileLayer);
break;
+ case LOEvent.CHANGE_HANDLE_POSITION:
+ changeHandlePosition(event.mHandleType, event.mDocumentCoordinate);
+ break;
+ }
+ }
+
+ private void changeHandlePosition(TextSelectionHandle.HandleType handleType, PointF documentCoordinate) {
+ if (handleType == TextSelectionHandle.HandleType.MIDDLE) {
+ LibreOfficeMainActivity.mAppContext.showSoftKeyboard();
+ mInvalidationHandler.setOverlayState(InvalidationHandler.OverlayState.CURSOR);
+ mTileProvider.mouseButtonDown(documentCoordinate, 1);
+ mTileProvider.mouseButtonUp(documentCoordinate, 1);
+ } else if (handleType == TextSelectionHandle.HandleType.START) {
+ mTileProvider.setTextSelectionStart(documentCoordinate);
+ } else if (handleType == TextSelectionHandle.HandleType.END) {
+ mTileProvider.setTextSelectionEnd(documentCoordinate);
}
}