[Libreoffice-commits] core.git: Branch 'feature/tiled-editing' - 5 commits - android/experimental
Tomaž Vajngerl
tomaz.vajngerl at collabora.co.uk
Thu Feb 26 02:47:36 PST 2015
android/experimental/LOAndroid3/src/java/org/libreoffice/InvalidationHandler.java | 27 +++++-----
android/experimental/LOAndroid3/src/java/org/libreoffice/LOKitThread.java | 4 +
android/experimental/LOAndroid3/src/java/org/libreoffice/LOKitTileProvider.java | 5 +
android/experimental/LOAndroid3/src/java/org/libreoffice/MockTileProvider.java | 5 +
android/experimental/LOAndroid3/src/java/org/libreoffice/TileProvider.java | 2
5 files changed, 30 insertions(+), 13 deletions(-)
New commits:
commit 90374a63a6215e6571ab12608e81ba45df37f4f4
Author: Tomaž Vajngerl <tomaz.vajngerl at collabora.co.uk>
Date: Thu Feb 26 19:46:11 2015 +0900
android: reset selections in TextCursorView on empty invalidation
Change-Id: I49997520057763299add18fb7c1bc662ef0c76b3
diff --git a/android/experimental/LOAndroid3/src/java/org/libreoffice/InvalidationHandler.java b/android/experimental/LOAndroid3/src/java/org/libreoffice/InvalidationHandler.java
index 630ffff..1f3b39b 100644
--- a/android/experimental/LOAndroid3/src/java/org/libreoffice/InvalidationHandler.java
+++ b/android/experimental/LOAndroid3/src/java/org/libreoffice/InvalidationHandler.java
@@ -8,6 +8,7 @@ import org.mozilla.gecko.TextSelection;
import org.mozilla.gecko.TextSelectionHandle;
import java.util.ArrayList;
+import java.util.Collections;
import java.util.List;
/**
@@ -207,6 +208,7 @@ public class InvalidationHandler {
mState = OverlayState.CURSOR;
mTextSelection.hideHandle(TextSelectionHandle.HandleType.START);
mTextSelection.hideHandle(TextSelectionHandle.HandleType.END);
+ mTextCursorLayer.changeSelections(Collections.EMPTY_LIST);
} else {
mState = OverlayState.SELECTION;
List<RectF> rects = convertPayloadToRectangles(payload);
commit fe46b7b31768834a4bf58f0b8296f6941ac74931
Author: Tomaž Vajngerl <tomaz.vajngerl at collabora.co.uk>
Date: Thu Feb 26 19:36:54 2015 +0900
android: if in selection state, reset selection on single tap
Change-Id: I8ae76ee4898087998b88ac2e1d73b3843fc00559
diff --git a/android/experimental/LOAndroid3/src/java/org/libreoffice/InvalidationHandler.java b/android/experimental/LOAndroid3/src/java/org/libreoffice/InvalidationHandler.java
index 9e328d6..630ffff 100644
--- a/android/experimental/LOAndroid3/src/java/org/libreoffice/InvalidationHandler.java
+++ b/android/experimental/LOAndroid3/src/java/org/libreoffice/InvalidationHandler.java
@@ -52,6 +52,10 @@ public class InvalidationHandler {
}
}
+ public OverlayState getOverlayState() {
+ return mState;
+ }
+
public void setOverlayState(OverlayState state) {
this.mState = state;
}
diff --git a/android/experimental/LOAndroid3/src/java/org/libreoffice/LOKitThread.java b/android/experimental/LOAndroid3/src/java/org/libreoffice/LOKitThread.java
index 39a200c..334cd44 100644
--- a/android/experimental/LOAndroid3/src/java/org/libreoffice/LOKitThread.java
+++ b/android/experimental/LOAndroid3/src/java/org/libreoffice/LOKitThread.java
@@ -255,6 +255,9 @@ public class LOKitThread extends Thread {
mInvalidationHandler.setOverlayState(InvalidationHandler.OverlayState.CURSOR);
mTileProvider.mouseButtonDown(documentCoordinate, 1);
mTileProvider.mouseButtonUp(documentCoordinate, 1);
+ if (mInvalidationHandler.getOverlayState() == InvalidationHandler.OverlayState.SELECTION) {
+ mTileProvider.setTextSelectionReset();
+ }
}
}
commit 53cac6b125193bf7121d3e8f13ed421e405ec712
Author: Tomaž Vajngerl <tomaz.vajngerl at collabora.co.uk>
Date: Thu Feb 26 19:36:10 2015 +0900
android: add selection reset to TileProvider
Change-Id: I9a42913069dcaa2bab1e3db51cebe3a0cdcf5746
diff --git a/android/experimental/LOAndroid3/src/java/org/libreoffice/LOKitTileProvider.java b/android/experimental/LOAndroid3/src/java/org/libreoffice/LOKitTileProvider.java
index f3af706..c2d59e0 100644
--- a/android/experimental/LOAndroid3/src/java/org/libreoffice/LOKitTileProvider.java
+++ b/android/experimental/LOAndroid3/src/java/org/libreoffice/LOKitTileProvider.java
@@ -354,6 +354,11 @@ public class LOKitTileProvider implements TileProvider, Document.MessageCallback
}
@Override
+ public void setTextSelectionReset() {
+ mDocument.setTextSelection(Document.TEXT_SELECTION_RESET, 0, 0);
+ }
+
+ @Override
protected void finalize() throws Throwable {
close();
super.finalize();
diff --git a/android/experimental/LOAndroid3/src/java/org/libreoffice/MockTileProvider.java b/android/experimental/LOAndroid3/src/java/org/libreoffice/MockTileProvider.java
index b4f1b82..66ad101 100644
--- a/android/experimental/LOAndroid3/src/java/org/libreoffice/MockTileProvider.java
+++ b/android/experimental/LOAndroid3/src/java/org/libreoffice/MockTileProvider.java
@@ -115,6 +115,11 @@ public class MockTileProvider implements TileProvider {
}
@Override
+ public void setTextSelectionReset() {
+
+ }
+
+ @Override
public void changePart(int partIndex) {
}
diff --git a/android/experimental/LOAndroid3/src/java/org/libreoffice/TileProvider.java b/android/experimental/LOAndroid3/src/java/org/libreoffice/TileProvider.java
index d749f78..6c284ce 100644
--- a/android/experimental/LOAndroid3/src/java/org/libreoffice/TileProvider.java
+++ b/android/experimental/LOAndroid3/src/java/org/libreoffice/TileProvider.java
@@ -86,4 +86,6 @@ public interface TileProvider {
void setTextSelectionStart(PointF documentCoordinate);
void setTextSelectionEnd(PointF documentCoordinate);
+
+ void setTextSelectionReset();
}
commit cc3c762a28dd0452cd4e8a2a85c859f02d770dbd
Author: Tomaž Vajngerl <tomaz.vajngerl at collabora.co.uk>
Date: Thu Feb 26 19:24:12 2015 +0900
android: still process cursor invalidations when in selection mode
Change-Id: I24d0b4f58e2227b289eb55cb881664e2cb5a51e9
diff --git a/android/experimental/LOAndroid3/src/java/org/libreoffice/InvalidationHandler.java b/android/experimental/LOAndroid3/src/java/org/libreoffice/InvalidationHandler.java
index d9d4f5e..9e328d6 100644
--- a/android/experimental/LOAndroid3/src/java/org/libreoffice/InvalidationHandler.java
+++ b/android/experimental/LOAndroid3/src/java/org/libreoffice/InvalidationHandler.java
@@ -141,19 +141,16 @@ public class InvalidationHandler {
* @param payload
*/
private void invalidateCursor(String payload) {
- if (mState == OverlayState.CURSOR) {
- RectF cursorRectangle = convertPayloadToRectangle(payload);
- if (cursorRectangle != null) {
- TextSelection textSelection = LibreOfficeMainActivity.mAppContext.getTextSelection();
- textSelection.positionHandle(TextSelectionHandle.HandleType.MIDDLE, createRectangleUnderSelection(cursorRectangle));
- textSelection.showHandle(TextSelectionHandle.HandleType.MIDDLE);
- textSelection.hideHandle(TextSelectionHandle.HandleType.START);
- textSelection.hideHandle(TextSelectionHandle.HandleType.END);
-
- TextCursorLayer textCursorLayer = LibreOfficeMainActivity.mAppContext.getTextCursorLayer();
- textCursorLayer.positionCursor(cursorRectangle);
- textCursorLayer.showCursor();
+ RectF cursorRectangle = convertPayloadToRectangle(payload);
+ if (cursorRectangle != null) {
+ if (mState == OverlayState.CURSOR) {
+ mTextSelection.positionHandle(TextSelectionHandle.HandleType.MIDDLE, createRectangleUnderSelection(cursorRectangle));
+ mTextSelection.showHandle(TextSelectionHandle.HandleType.MIDDLE);
+ mTextSelection.hideHandle(TextSelectionHandle.HandleType.START);
+ mTextSelection.hideHandle(TextSelectionHandle.HandleType.END);
}
+ mTextCursorLayer.positionCursor(cursorRectangle);
+ mTextCursorLayer.showCursor();
}
}
commit c3f45f3cb62c51bdf24a27826991163eaf25f98f
Author: Tomaž Vajngerl <tomaz.vajngerl at collabora.co.uk>
Date: Thu Feb 26 19:22:25 2015 +0900
android: don't hide soft keyboard on long press
Change-Id: I8b1f6057b08752171710e1e5d4d0ab4664a63369
diff --git a/android/experimental/LOAndroid3/src/java/org/libreoffice/LOKitThread.java b/android/experimental/LOAndroid3/src/java/org/libreoffice/LOKitThread.java
index fc576c6b..39a200c 100644
--- a/android/experimental/LOAndroid3/src/java/org/libreoffice/LOKitThread.java
+++ b/android/experimental/LOAndroid3/src/java/org/libreoffice/LOKitThread.java
@@ -248,7 +248,6 @@ public class LOKitThread extends Thread {
return;
}
if (touchType.equals("LongPress")) {
- LibreOfficeMainActivity.mAppContext.hideSoftKeyboard();
mInvalidationHandler.setOverlayState(InvalidationHandler.OverlayState.SELECTION);
mTileProvider.mouseButtonDown(documentCoordinate, 2);
} else { // "SingleTap"
More information about the Libreoffice-commits
mailing list