Kaydet (Commit) 2b5cf239 authored tarafından Miklos Vajna's avatar Miklos Vajna

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
üst b0cb454f
...@@ -3,6 +3,7 @@ package org.libreoffice; ...@@ -3,6 +3,7 @@ package org.libreoffice;
import android.content.Intent; import android.content.Intent;
import android.graphics.RectF; import android.graphics.RectF;
import android.net.Uri; import android.net.Uri;
import android.util.Log;
import org.libreoffice.kit.Document; import org.libreoffice.kit.Document;
import org.mozilla.gecko.TextSelection; import org.mozilla.gecko.TextSelection;
...@@ -211,7 +212,9 @@ public class InvalidationHandler implements Document.MessageCallback { ...@@ -211,7 +212,9 @@ public class InvalidationHandler implements Document.MessageCallback {
private synchronized void cursorVisibility(String payload) { private synchronized void cursorVisibility(String payload) {
if (payload.equals("true")) { if (payload.equals("true")) {
mTextCursorLayer.showCursor(); mTextCursorLayer.showCursor();
mTextSelection.showHandle(TextSelectionHandle.HandleType.MIDDLE); if (mState != OverlayState.SELECTION) {
mTextSelection.showHandle(TextSelectionHandle.HandleType.MIDDLE);
}
} else if (payload.equals("false")) { } else if (payload.equals("false")) {
mTextCursorLayer.hideCursor(); mTextCursorLayer.hideCursor();
mTextSelection.hideHandle(TextSelectionHandle.HandleType.MIDDLE); mTextSelection.hideHandle(TextSelectionHandle.HandleType.MIDDLE);
......
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