diff options
author | Tomaž Vajngerl <tomaz.vajngerl@collabora.co.uk> | 2015-01-21 13:44:06 +0900 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.co.uk> | 2015-01-26 10:27:40 +0100 |
commit | 5ad41801910890be3eec7158aa867aa626f2c82e (patch) | |
tree | 35be8d7f3bf887a88d8c9321d7cc8d9a644f6945 /android | |
parent | 07a736ff67c0f6ed96a26b7fb165b3a1f81ef73f (diff) |
android: make editing switchable via LOKitShell
Change-Id: I329dbead616527a985eba1f3b42cddf573501e86
Diffstat (limited to 'android')
-rw-r--r-- | android/experimental/LOAndroid3/src/java/org/libreoffice/LOKitShell.java | 4 | ||||
-rw-r--r-- | android/experimental/LOAndroid3/src/java/org/libreoffice/LOKitThread.java | 10 |
2 files changed, 14 insertions, 0 deletions
diff --git a/android/experimental/LOAndroid3/src/java/org/libreoffice/LOKitShell.java b/android/experimental/LOAndroid3/src/java/org/libreoffice/LOKitShell.java index ac3e360649e5..49da6b42d7b2 100644 --- a/android/experimental/LOAndroid3/src/java/org/libreoffice/LOKitShell.java +++ b/android/experimental/LOAndroid3/src/java/org/libreoffice/LOKitShell.java @@ -82,4 +82,8 @@ public class LOKitShell { public static void sendKeyPressEvent(KeyEvent event) { LOKitShell.sendEvent(new LOEvent(LOEvent.KEY_PRESS, event)); } + + public static boolean isEditingEnabled() { + return false; + } } diff --git a/android/experimental/LOAndroid3/src/java/org/libreoffice/LOKitThread.java b/android/experimental/LOAndroid3/src/java/org/libreoffice/LOKitThread.java index 9954ea866292..ed63cd7f1f9c 100644 --- a/android/experimental/LOAndroid3/src/java/org/libreoffice/LOKitThread.java +++ b/android/experimental/LOAndroid3/src/java/org/libreoffice/LOKitThread.java @@ -147,9 +147,15 @@ public class LOKitThread extends Thread implements TileProvider.TileInvalidation createThumbnail(event.mTask); break; case LOEvent.TOUCH: + if (!LOKitShell.isEditingEnabled()) { + return; + } touch(event.mTouchType, event.mMotionEvent); break; case LOEvent.KEY_PRESS: + if (!LOKitShell.isEditingEnabled()) { + return; + } mTileProvider.keyPress(event.mKeyEvent); break; } @@ -174,6 +180,10 @@ public class LOKitThread extends Thread implements TileProvider.TileInvalidation @Override public void invalidate(RectF rect) { + if (!LOKitShell.isEditingEnabled()) { + return; + } + Log.i(LOGTAG, "Invalidate request: " + rect); mLayerClient = mApplication.getLayerClient(); |