summaryrefslogtreecommitdiff
path: root/android
diff options
context:
space:
mode:
authorTomaž Vajngerl <tomaz.vajngerl@collabora.co.uk>2015-01-16 18:06:44 +0900
committerMiklos Vajna <vmiklos@collabora.co.uk>2015-01-16 13:18:33 +0100
commit389fae7cbafac76591fb99054f0fcaeefb441a37 (patch)
treeae22889741f520242343de14b0d7bbc7281b5b4e /android
parent376639778151e433371941487d030e157a6b75ef (diff)
android: Add some comments.
Change-Id: I77372ae2b1c7c4332dc4a8c244c67a82f9551e22
Diffstat (limited to 'android')
-rw-r--r--android/experimental/LOAndroid3/src/java/org/libreoffice/LOKitShell.java9
-rw-r--r--android/experimental/LOAndroid3/src/java/org/libreoffice/LOKitTileProvider.java9
-rw-r--r--android/experimental/LOAndroid3/src/java/org/libreoffice/LibreOfficeMainActivity.java8
3 files changed, 26 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 03b9aaf78020..52066941c2e3 100644
--- a/android/experimental/LOAndroid3/src/java/org/libreoffice/LOKitShell.java
+++ b/android/experimental/LOAndroid3/src/java/org/libreoffice/LOKitShell.java
@@ -49,6 +49,9 @@ public class LOKitShell {
// EVENTS
+ /**
+ * Make sure LOKitThread is running and send event to it.
+ */
public static void sendEvent(LOEvent event) {
if (LibreOfficeMainActivity.mAppContext != null && LibreOfficeMainActivity.mAppContext.getLOKitThread() != null) {
LibreOfficeMainActivity.mAppContext.getLOKitThread().queueEvent(event);
@@ -59,10 +62,16 @@ public class LOKitShell {
LOKitShell.sendEvent(new LOEvent(LOEvent.THUMBNAIL, task));
}
+ /**
+ * Send touch event to LOKitThread.
+ */
public static void sentTouchEvent(String touchType, MotionEvent motionEvent) {
LOKitShell.sendEvent(new LOEvent(LOEvent.TOUCH, "SingleTap", motionEvent));
}
+ /**
+ * Send key press event to LOKitThread.
+ */
public static void sendKeyPressEvent(KeyEvent event) {
LOKitShell.sendEvent(new LOEvent(LOEvent.KEY_PRESS, event));
}
diff --git a/android/experimental/LOAndroid3/src/java/org/libreoffice/LOKitTileProvider.java b/android/experimental/LOAndroid3/src/java/org/libreoffice/LOKitTileProvider.java
index 7eda1f16ce58..b7dee3bec7cc 100644
--- a/android/experimental/LOAndroid3/src/java/org/libreoffice/LOKitTileProvider.java
+++ b/android/experimental/LOAndroid3/src/java/org/libreoffice/LOKitTileProvider.java
@@ -15,6 +15,9 @@ import org.mozilla.gecko.gfx.IntSize;
import java.nio.ByteBuffer;
+/**
+ * LOKit implementation of TileProvider.
+ */
public class LOKitTileProvider implements TileProvider, Document.MessageCallback {
private static final String LOGTAG = LOKitTileProvider.class.getSimpleName();
private static int TILE_SIZE = 256;
@@ -261,6 +264,9 @@ public class LOKitTileProvider implements TileProvider, Document.MessageCallback
return mDocument != null && mDocument.getDocumentType() == Document.DOCTYPE_TEXT;
}
+ /**
+ * Register the tile invalidation callback.
+ */
@Override
public void registerInvalidationCallback(TileInvalidationCallback tileInvalidationCallback) {
this.tileInvalidationCallback = tileInvalidationCallback;
@@ -284,6 +290,9 @@ public class LOKitTileProvider implements TileProvider, Document.MessageCallback
return mDocument.getPart();
}
+ /**
+ * Process the retrieved messages from LOK
+ */
@Override
public void messageRetrieved(int signalNumber, String payload) {
switch (signalNumber) {
diff --git a/android/experimental/LOAndroid3/src/java/org/libreoffice/LibreOfficeMainActivity.java b/android/experimental/LOAndroid3/src/java/org/libreoffice/LibreOfficeMainActivity.java
index b79217db0d5a..5efbc681b362 100644
--- a/android/experimental/LOAndroid3/src/java/org/libreoffice/LibreOfficeMainActivity.java
+++ b/android/experimental/LOAndroid3/src/java/org/libreoffice/LibreOfficeMainActivity.java
@@ -192,6 +192,10 @@ public class LibreOfficeMainActivity extends LOAbout {
return mDocumentPartViewListAdapter;
}
+ /**
+ * Show software keyboard.
+ * Force the request on main thread.
+ */
public void showSoftKeyboard() {
Log.i(LOGTAG, "SoftKeyboard show request..");
@@ -241,6 +245,10 @@ public class LibreOfficeMainActivity extends LOAbout {
}
}
+
+ /**
+ * Listen to key presses and send event to LOK.
+ */
@Override
public boolean onKeyDown(int keyCode, KeyEvent event) {
LOKitShell.sendKeyPressEvent(event);