summaryrefslogtreecommitdiff
path: root/android
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.co.uk>2015-03-19 17:53:38 +0100
committerMiklos Vajna <vmiklos@collabora.co.uk>2015-03-23 09:19:05 +0100
commit2b5cf2391078f80e31c3cc974b7d82927ab53175 (patch)
tree1977ead076ff69cb0c79cb31b5665a428563cc92 /android
parentb0cb454f4a1060bb18f69a4e54714ca0fe8acf65 (diff)
android: when in selection, avoid showing the middle handle
editeng sends LOK_CALLBACK_CURSOR_VISIBLE after the text selection is already created. The effect of this is that after a long push on a word you get not only the selection overlay + the start/end handles, but also the middle one, which is not expected. Just check if we're in a selection already, and if so, don't react to LOK_CALLBACK_CURSOR_VISIBLE=true. Change-Id: I939c957feb7889dfb1997fac1051cb4eaa77004c
Diffstat (limited to 'android')
-rw-r--r--android/experimental/LOAndroid3/src/java/org/libreoffice/InvalidationHandler.java5
1 files changed, 4 insertions, 1 deletions
diff --git a/android/experimental/LOAndroid3/src/java/org/libreoffice/InvalidationHandler.java b/android/experimental/LOAndroid3/src/java/org/libreoffice/InvalidationHandler.java
index e9110f61b049..805ed9c61d60 100644
--- a/android/experimental/LOAndroid3/src/java/org/libreoffice/InvalidationHandler.java
+++ b/android/experimental/LOAndroid3/src/java/org/libreoffice/InvalidationHandler.java
@@ -3,6 +3,7 @@ package org.libreoffice;
import android.content.Intent;
import android.graphics.RectF;
import android.net.Uri;
+import android.util.Log;
import org.libreoffice.kit.Document;
import org.mozilla.gecko.TextSelection;
@@ -211,7 +212,9 @@ public class InvalidationHandler implements Document.MessageCallback {
private synchronized void cursorVisibility(String payload) {
if (payload.equals("true")) {
mTextCursorLayer.showCursor();
- mTextSelection.showHandle(TextSelectionHandle.HandleType.MIDDLE);
+ if (mState != OverlayState.SELECTION) {
+ mTextSelection.showHandle(TextSelectionHandle.HandleType.MIDDLE);
+ }
} else if (payload.equals("false")) {
mTextCursorLayer.hideCursor();
mTextSelection.hideHandle(TextSelectionHandle.HandleType.MIDDLE);