[Libreoffice-commits] core.git: Branch 'feature/tiled-editing' - android/experimental

2015-04-09 Thread Tomaž Vajngerl
 
android/experimental/LOAndroid3/src/java/org/libreoffice/InvalidationHandler.java
 |   38 +-
 android/experimental/LOAndroid3/src/java/org/libreoffice/LOKitShell.java   
   |2 
 
android/experimental/LOAndroid3/src/java/org/mozilla/gecko/gfx/JavaPanZoomController.java
 |   13 +--
 3 files changed, 43 insertions(+), 10 deletions(-)

New commits:
commit 47bf36924c5f156cee40aa31f341015c66765c6a
Author: Tomaž Vajngerl tomaz.vajng...@collabora.co.uk
Date:   Thu Apr 9 17:27:31 2015 +0900

android: tune the viewport moving to cursor position on key input

Change-Id: Ie420307f28cc05ca03fabe47f46712f67c6f18fa

diff --git 
a/android/experimental/LOAndroid3/src/java/org/libreoffice/InvalidationHandler.java
 
b/android/experimental/LOAndroid3/src/java/org/libreoffice/InvalidationHandler.java
index 9f83006..1fdc681 100644
--- 
a/android/experimental/LOAndroid3/src/java/org/libreoffice/InvalidationHandler.java
+++ 
b/android/experimental/LOAndroid3/src/java/org/libreoffice/InvalidationHandler.java
@@ -8,6 +8,8 @@ import android.net.Uri;
 import org.libreoffice.canvas.SelectionHandle;
 import org.libreoffice.kit.Document;
 import org.libreoffice.overlay.DocumentOverlay;
+import org.mozilla.gecko.gfx.GeckoLayerClient;
+import org.mozilla.gecko.gfx.ImmutableViewportMetrics;
 
 import java.util.ArrayList;
 import java.util.Collections;
@@ -19,11 +21,13 @@ import java.util.List;
 public class InvalidationHandler implements Document.MessageCallback {
 private static String LOGTAG = InvalidationHandler.class.getSimpleName();
 private final DocumentOverlay mDocumentOverlay;
+private final GeckoLayerClient mLayerClient;
 private OverlayState mState;
 private boolean mKeyEvent = false;
 
 public InvalidationHandler(LibreOfficeMainActivity mainActivity) {
 mDocumentOverlay = mainActivity.getDocumentOverlay();
+mLayerClient = mainActivity.getLayerClient();
 mState = OverlayState.NONE;
 }
 
@@ -153,8 +157,7 @@ public class InvalidationHandler implements 
Document.MessageCallback {
 mDocumentOverlay.positionHandle(SelectionHandle.HandleType.MIDDLE, 
cursorRectangle);
 
 if (mKeyEvent) {
-PointF point = new PointF(cursorRectangle.centerX(), 
cursorRectangle.centerY());
-LOKitShell.moveViewportTo(point, null);
+moveViewportToMakeCursorVisible(cursorRectangle);
 mKeyEvent = false;
 }
 
@@ -165,6 +168,37 @@ public class InvalidationHandler implements 
Document.MessageCallback {
 }
 
 /**
+ * Move the viewport to show the cursor. The cursor will appear at the
+ * viewport position depending on where the cursor is relative to the
+ * viewport (either cursor is above, below, on left or right).
+ *
+ * @param cursorRectangle - cursor position on the document
+ */
+public void moveViewportToMakeCursorVisible(RectF cursorRectangle) {
+RectF moveToRect = mLayerClient.getViewportMetrics().getCssViewport();
+if (moveToRect.contains(cursorRectangle)) {
+return;
+}
+
+float newLeft = moveToRect.left;
+float newTop = moveToRect.top;
+
+if (cursorRectangle.right  moveToRect.left || cursorRectangle.left  
moveToRect.left) {
+newLeft = cursorRectangle.left -  (moveToRect.width() * 0.1f);
+} else if (cursorRectangle.right  moveToRect.right || 
cursorRectangle.left  moveToRect.right) {
+newLeft = cursorRectangle.right - (moveToRect.width() * 0.9f);
+}
+
+if (cursorRectangle.top  moveToRect.top || cursorRectangle.bottom  
moveToRect.top) {
+newTop = cursorRectangle.top - (moveToRect.height() * 0.1f);
+} else if (cursorRectangle.bottom  moveToRect.bottom || 
cursorRectangle.top  moveToRect.bottom) {
+newTop = cursorRectangle.bottom - (moveToRect.height() / 2.0f);
+}
+
+LOKitShell.moveViewportTo(new PointF(newLeft, newTop), null);
+}
+
+/**
  * Handles the text selection start message
  *
  * @param payload
diff --git 
a/android/experimental/LOAndroid3/src/java/org/libreoffice/LOKitShell.java 
b/android/experimental/LOAndroid3/src/java/org/libreoffice/LOKitShell.java
index 99f9948..d9a20d8 100644
--- a/android/experimental/LOAndroid3/src/java/org/libreoffice/LOKitShell.java
+++ b/android/experimental/LOAndroid3/src/java/org/libreoffice/LOKitShell.java
@@ -158,7 +158,7 @@ public class LOKitShell {
 }
 
 /**
- * Move the viewport to the desired point, and change the zoom level.
+ * Move the viewport to the desired point (top-left), and change the zoom 
level.
  * Ensure this runs on the UI thread.
  */
 public static void moveViewportTo(final PointF position, final Float zoom) 
{
diff --git 
a/android/experimental/LOAndroid3/src/java/org/mozilla/gecko/gfx/JavaPanZoomController.java
 

[Libreoffice-commits] core.git: Branch 'feature/tiled-editing' - android/experimental

2015-04-06 Thread Siqi Liu
 android/experimental/LOAndroid3/res/drawable-hdpi/action_bold.png  
   |binary
 android/experimental/LOAndroid3/res/drawable-hdpi/action_italic.png
   |binary
 android/experimental/LOAndroid3/res/drawable-hdpi/action_underline.png 
   |binary
 android/experimental/LOAndroid3/res/drawable-mdpi/action_bold.png  
   |binary
 android/experimental/LOAndroid3/res/drawable-mdpi/action_italic.png
   |binary
 android/experimental/LOAndroid3/res/drawable-mdpi/action_underline.png 
   |binary
 android/experimental/LOAndroid3/res/drawable-xhdpi/action_bold.png 
   |binary
 android/experimental/LOAndroid3/res/drawable-xhdpi/action_italic.png   
   |binary
 android/experimental/LOAndroid3/res/drawable-xhdpi/action_underline.png
   |binary
 android/experimental/LOAndroid3/res/drawable-xxxhdpi/action_bold.png   
   |binary
 android/experimental/LOAndroid3/res/drawable-xxxhdpi/action_italic.png 
   |binary
 android/experimental/LOAndroid3/res/drawable-xxxhdpi/action_underline.png  
   |binary
 android/experimental/LOAndroid3/res/menu/main.xml  
   |   14 +-
 android/experimental/LOAndroid3/res/values/strings.xml 
   |2 +
 
android/experimental/LOAndroid3/src/java/org/libreoffice/LibreOfficeMainActivity.java
 |6 
 dev/null   
   |binary
 16 files changed, 21 insertions(+), 1 deletion(-)

New commits:
commit b4e48845662a3c4fde6f9c4fb2219f676cdd693c
Author: Siqi Liu m...@siqi.fr
Date:   Mon Apr 6 11:58:49 2015 +0200

add italic/underline button with icons for different screen res

Change-Id: Ib158f32af7ef8d65d4ddd822839b260161a74343

diff --git a/android/experimental/LOAndroid3/res/drawable-hdpi/action_bold.png 
b/android/experimental/LOAndroid3/res/drawable-hdpi/action_bold.png
new file mode 100644
index 000..950d615
Binary files /dev/null and 
b/android/experimental/LOAndroid3/res/drawable-hdpi/action_bold.png differ
diff --git 
a/android/experimental/LOAndroid3/res/drawable-hdpi/action_italic.png 
b/android/experimental/LOAndroid3/res/drawable-hdpi/action_italic.png
new file mode 100644
index 000..399bb9c
Binary files /dev/null and 
b/android/experimental/LOAndroid3/res/drawable-hdpi/action_italic.png differ
diff --git 
a/android/experimental/LOAndroid3/res/drawable-hdpi/action_underline.png 
b/android/experimental/LOAndroid3/res/drawable-hdpi/action_underline.png
new file mode 100644
index 000..09f8b20
Binary files /dev/null and 
b/android/experimental/LOAndroid3/res/drawable-hdpi/action_underline.png differ
diff --git a/android/experimental/LOAndroid3/res/drawable-mdpi/action_bold.png 
b/android/experimental/LOAndroid3/res/drawable-mdpi/action_bold.png
new file mode 100644
index 000..bc60968
Binary files /dev/null and 
b/android/experimental/LOAndroid3/res/drawable-mdpi/action_bold.png differ
diff --git 
a/android/experimental/LOAndroid3/res/drawable-mdpi/action_italic.png 
b/android/experimental/LOAndroid3/res/drawable-mdpi/action_italic.png
new file mode 100644
index 000..6394cf9
Binary files /dev/null and 
b/android/experimental/LOAndroid3/res/drawable-mdpi/action_italic.png differ
diff --git 
a/android/experimental/LOAndroid3/res/drawable-mdpi/action_underline.png 
b/android/experimental/LOAndroid3/res/drawable-mdpi/action_underline.png
new file mode 100644
index 000..3b6c7f6
Binary files /dev/null and 
b/android/experimental/LOAndroid3/res/drawable-mdpi/action_underline.png differ
diff --git a/android/experimental/LOAndroid3/res/drawable-xhdpi/action_bold.png 
b/android/experimental/LOAndroid3/res/drawable-xhdpi/action_bold.png
new file mode 100644
index 000..95c985e
Binary files /dev/null and 
b/android/experimental/LOAndroid3/res/drawable-xhdpi/action_bold.png differ
diff --git 
a/android/experimental/LOAndroid3/res/drawable-xhdpi/action_italic.png 
b/android/experimental/LOAndroid3/res/drawable-xhdpi/action_italic.png
new file mode 100644
index 000..e4366f4
Binary files /dev/null and 
b/android/experimental/LOAndroid3/res/drawable-xhdpi/action_italic.png differ
diff --git 
a/android/experimental/LOAndroid3/res/drawable-xhdpi/action_underline.png 
b/android/experimental/LOAndroid3/res/drawable-xhdpi/action_underline.png
new file mode 100644
index 000..421a750
Binary files /dev/null and 
b/android/experimental/LOAndroid3/res/drawable-xhdpi/action_underline.png differ
diff --git 
a/android/experimental/LOAndroid3/res/drawable-xxxhdpi/action_bold.png 
b/android/experimental/LOAndroid3/res/drawable-xxxhdpi/action_bold.png
new file mode 100644
index 000..c5256f5
Binary files /dev/null and 
b/android/experimental/LOAndroid3/res/drawable-xxxhdpi/action_bold.png differ
diff --git 
a/android/experimental/LOAndroid3/res/drawable-xxxhdpi/action_italic.png 

[Libreoffice-commits] core.git: Branch 'feature/tiled-editing' - android/experimental

2015-04-06 Thread Siqi Liu
 android/experimental/LOAndroid3/res/menu/main.xml  
   |8 ++--
 android/experimental/LOAndroid3/res/values/strings.xml 
   |1 +
 
android/experimental/LOAndroid3/src/java/org/libreoffice/LibreOfficeMainActivity.java
 |4 
 3 files changed, 11 insertions(+), 2 deletions(-)

New commits:
commit 9d7142cd2615d1365b36d831be81d2adbde010bc
Author: Siqi Liu m...@siqi.fr
Date:   Mon Apr 6 12:10:09 2015 +0200

add saving action placeholder

Change-Id: Ibb4595e297a4328f2bb108e1b9e71bb50843e3b9

diff --git a/android/experimental/LOAndroid3/res/menu/main.xml 
b/android/experimental/LOAndroid3/res/menu/main.xml
index 1a1c22a..979bbd1 100644
--- a/android/experimental/LOAndroid3/res/menu/main.xml
+++ b/android/experimental/LOAndroid3/res/menu/main.xml
@@ -28,11 +28,15 @@
   android:orderInCategory=100
   app:showAsAction=always/
 
-item android:id=@+id/action_about
-android:title=@string/action_about
+item android:id=@+id/action_save
+android:title=@string/action_save
 android:orderInCategory=100 /
 
 item android:id=@+id/action_parts
   android:title=@string/action_parts
   android:orderInCategory=100 /
+
+item android:id=@+id/action_about
+android:title=@string/action_about
+android:orderInCategory=100 /
 /menu
diff --git a/android/experimental/LOAndroid3/res/values/strings.xml 
b/android/experimental/LOAndroid3/res/values/strings.xml
index 939804d..0b9e7a2 100644
--- a/android/experimental/LOAndroid3/res/values/strings.xml
+++ b/android/experimental/LOAndroid3/res/values/strings.xml
@@ -38,5 +38,6 @@
 string name=action_underlineUnderline/string
 string name=action_italicItalic/string
 string name=action_keyboardShow keyboard/string
+string name=action_saveSave/string
 
 /resources
diff --git 
a/android/experimental/LOAndroid3/src/java/org/libreoffice/LibreOfficeMainActivity.java
 
b/android/experimental/LOAndroid3/src/java/org/libreoffice/LibreOfficeMainActivity.java
index ed87f8c..4664687 100644
--- 
a/android/experimental/LOAndroid3/src/java/org/libreoffice/LibreOfficeMainActivity.java
+++ 
b/android/experimental/LOAndroid3/src/java/org/libreoffice/LibreOfficeMainActivity.java
@@ -16,6 +16,7 @@ import android.view.View;
 import android.view.inputmethod.InputMethodManager;
 import android.widget.AdapterView;
 import android.widget.ListView;
+import android.widget.Toast;
 
 import org.libreoffice.overlay.TextCursorLayer;
 import org.mozilla.gecko.ZoomConstraints;
@@ -90,6 +91,9 @@ public class LibreOfficeMainActivity extends 
ActionBarActivity {
 case R.id.action_about:
 mAbout.showAbout();
 return true;
+case R.id.action_save:
+Toast.makeText(this, saving the document..., 
Toast.LENGTH_SHORT).show();
+return true;
 case R.id.action_parts:
 mDrawerLayout.openDrawer(mDrawerList);
 return true;
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'feature/tiled-editing' - android/experimental

2015-04-06 Thread Siqi Liu
 android/experimental/LOAndroid3/res/drawable-hdpi/action_strikeout.png 
   |binary
 android/experimental/LOAndroid3/res/drawable-mdpi/action_strikeout.png 
   |binary
 android/experimental/LOAndroid3/res/drawable-xhdpi/action_strikeout.png
   |binary
 android/experimental/LOAndroid3/res/drawable-xxxhdpi/action_strikeout.png  
   |binary
 android/experimental/LOAndroid3/res/menu/main.xml  
   |6 ++
 android/experimental/LOAndroid3/res/values/strings.xml 
   |1 +
 
android/experimental/LOAndroid3/src/java/org/libreoffice/LibreOfficeMainActivity.java
 |6 +-
 7 files changed, 12 insertions(+), 1 deletion(-)

New commits:
commit c2418ab28f5593593468100549cf81e96d99b221
Author: Siqi Liu m...@siqi.fr
Date:   Mon Apr 6 14:03:35 2015 +0200

implement strike out and .uno:Save

.uno:Save works out of box for when tested against documents (impress,
calc) loaded directly from dropbox for example. However, it doesn't work 
with
impress/calc documents loaded from local files. Writer documents won't
save, either locally or from network resources. More research needed.

Change-Id: Ibdcc209a71f14ec91ba9c1152b305e0278787713

diff --git 
a/android/experimental/LOAndroid3/res/drawable-hdpi/action_strikeout.png 
b/android/experimental/LOAndroid3/res/drawable-hdpi/action_strikeout.png
new file mode 100644
index 000..f7682ab
Binary files /dev/null and 
b/android/experimental/LOAndroid3/res/drawable-hdpi/action_strikeout.png differ
diff --git 
a/android/experimental/LOAndroid3/res/drawable-mdpi/action_strikeout.png 
b/android/experimental/LOAndroid3/res/drawable-mdpi/action_strikeout.png
new file mode 100644
index 000..955f1cb
Binary files /dev/null and 
b/android/experimental/LOAndroid3/res/drawable-mdpi/action_strikeout.png differ
diff --git 
a/android/experimental/LOAndroid3/res/drawable-xhdpi/action_strikeout.png 
b/android/experimental/LOAndroid3/res/drawable-xhdpi/action_strikeout.png
new file mode 100644
index 000..e9eccc8
Binary files /dev/null and 
b/android/experimental/LOAndroid3/res/drawable-xhdpi/action_strikeout.png differ
diff --git 
a/android/experimental/LOAndroid3/res/drawable-xxxhdpi/action_strikeout.png 
b/android/experimental/LOAndroid3/res/drawable-xxxhdpi/action_strikeout.png
new file mode 100644
index 000..0b2c39f
Binary files /dev/null and 
b/android/experimental/LOAndroid3/res/drawable-xxxhdpi/action_strikeout.png 
differ
diff --git a/android/experimental/LOAndroid3/res/menu/main.xml 
b/android/experimental/LOAndroid3/res/menu/main.xml
index 979bbd1..09314f5 100644
--- a/android/experimental/LOAndroid3/res/menu/main.xml
+++ b/android/experimental/LOAndroid3/res/menu/main.xml
@@ -16,6 +16,12 @@
   android:orderInCategory=100
   app:showAsAction=always/
 
+item android:id=@+id/action_strikeout
+  android:title=@string/action_strikeout
+  android:icon=@drawable/action_strikeout
+  android:orderInCategory=100
+  app:showAsAction=always/
+
 item android:id=@+id/action_underline
   android:title=@string/action_underline
   android:icon=@drawable/action_underline
diff --git a/android/experimental/LOAndroid3/res/values/strings.xml 
b/android/experimental/LOAndroid3/res/values/strings.xml
index 0b9e7a2..ffce3d8 100644
--- a/android/experimental/LOAndroid3/res/values/strings.xml
+++ b/android/experimental/LOAndroid3/res/values/strings.xml
@@ -37,6 +37,7 @@
 string name=action_boldBold/string
 string name=action_underlineUnderline/string
 string name=action_italicItalic/string
+string name=action_strikeoutStrike Out/string
 string name=action_keyboardShow keyboard/string
 string name=action_saveSave/string
 
diff --git 
a/android/experimental/LOAndroid3/src/java/org/libreoffice/LibreOfficeMainActivity.java
 
b/android/experimental/LOAndroid3/src/java/org/libreoffice/LibreOfficeMainActivity.java
index 4664687..c831977 100644
--- 
a/android/experimental/LOAndroid3/src/java/org/libreoffice/LibreOfficeMainActivity.java
+++ 
b/android/experimental/LOAndroid3/src/java/org/libreoffice/LibreOfficeMainActivity.java
@@ -85,6 +85,9 @@ public class LibreOfficeMainActivity extends 
ActionBarActivity {
 case R.id.action_underline:
 LOKitShell.sendEvent(new LOEvent(LOEvent.UNO_COMMAND, 
.uno:Underline));
 return true;
+case R.id.action_strikeout:
+LOKitShell.sendEvent(new LOEvent(LOEvent.UNO_COMMAND, 
.uno:StrikeOut));
+return true;
 case R.id.action_keyboard:
 showSoftKeyboard();
 break;
@@ -92,7 +95,8 @@ public class LibreOfficeMainActivity extends 
ActionBarActivity {
 mAbout.showAbout();
 return true;
 case R.id.action_save:
-Toast.makeText(this, saving the document..., 

[Libreoffice-commits] core.git: Branch 'feature/tiled-editing' - android/experimental android/README

2015-04-03 Thread Miklos Vajna
 android/README 
 |6 +++---
 
android/experimental/LOAndroid3/src/java/org/libreoffice/ToolbarController.java 
|4 ++--
 2 files changed, 5 insertions(+), 5 deletions(-)

New commits:
commit db3b5c993c1c4bb20be5bc997e8e6ecd2f176e37
Author: Miklos Vajna vmik...@collabora.co.uk
Date:   Fri Apr 3 12:58:17 2015 +0200

android: Insure - Ensure

Change-Id: I33d8282210329d8bb3a471a7c717fcf653930e95

diff --git a/android/README b/android/README
index bd570e9..c0a7e93 100644
--- a/android/README
+++ b/android/README
@@ -77,7 +77,7 @@ Document view classes
 - GeckoLayerClient (org.mozilla.gecko.gfx.GeckoLayerClient) is the middle man 
of the
   application, which connects all the bits together. It is the document view 
layer
   holder so the any management (including tiled rendering) usually go through 
this
-  class. It listenes to draw requests and viewport changes from 
PanZoomController
+  class. It listens to draw requests and viewport changes from 
PanZoomController
   (see Touch events).
 
 Touch events, scrolling and zooming
@@ -128,7 +128,7 @@ For editing there are 2 coarse tasks that the LibreOffice 
app must do:
 
 In most cases when an input event happens and is send to the LO core, then a 
message from
 LO core follows. For example: when the user writes to the keyboard, key event 
is sent and
-a invalidation requst from LO core follows. When user touches an image, a 
mouse event is
+a invalidation request from LO core follows. When user touches an image, a 
mouse event is
 sent, and a new graphic selection message from LO core follows.
 
 All keyboard and touch events are send to LOKitThread as LOEvents. In 
LOKitThread they are
@@ -220,7 +220,7 @@ ERROR: Could not extract package's data directory. Are you 
sure that
 (gdb) python sys.path.insert(0, /master/solenv/gdb)
 (gdb) source /master/instdir/program/libuno_sal.so.3-gdb.py
 
-* Debuggint the Java part
+* Debugging the Java part
 
 At the moment the code is not organized in a way that would make Eclipse or
 Android Studio happy as-is, so the quickest way is to use the jdb command-line
diff --git 
a/android/experimental/LOAndroid3/src/java/org/libreoffice/ToolbarController.java
 
b/android/experimental/LOAndroid3/src/java/org/libreoffice/ToolbarController.java
index 504c2f3..358617f 100644
--- 
a/android/experimental/LOAndroid3/src/java/org/libreoffice/ToolbarController.java
+++ 
b/android/experimental/LOAndroid3/src/java/org/libreoffice/ToolbarController.java
@@ -28,7 +28,7 @@ public class ToolbarController {
  * Change the toolbar to edit mode.
  */
 void switchToEditMode() {
-// Insure the change is done on UI thread
+// Ensure the change is done on UI thread
 LOKitShell.getMainHandler().post(new Runnable() {
 @Override
 public void run() {
@@ -44,7 +44,7 @@ public class ToolbarController {
  * Change the toolbar to view mode.
  */
 void switchToViewMode() {
-// Insure the change is done on UI thread
+// Ensure the change is done on UI thread
 LOKitShell.getMainHandler().post(new Runnable() {
 @Override
 public void run() {
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'feature/tiled-editing' - android/experimental

2015-03-31 Thread Miklos Vajna
 android/experimental/LOAndroid3/Makefile |1 +
 1 file changed, 1 insertion(+)

New commits:
commit 5e3d6134a725f056104741b7ebd2d64e38a5704f
Author: Miklos Vajna vmik...@collabora.co.uk
Date:   Tue Mar 31 09:34:41 2015 +0200

android: fix 'make install' in LOAndroid3

The error was:

$ make install verbose=t
../../../config_host.mk:655: /git/config__lang.mk: No such file or directory
make: *** No rule to make target '/git/config__lang.mk'.  Stop.

Change-Id: I4f976c27217cb1827ce2a7b39c1bc301e45f149b

diff --git a/android/experimental/LOAndroid3/Makefile 
b/android/experimental/LOAndroid3/Makefile
index fbcec0c..346b995 100644
--- a/android/experimental/LOAndroid3/Makefile
+++ b/android/experimental/LOAndroid3/Makefile
@@ -1,4 +1,5 @@
 ifeq ($(BUILDDIR),)
+gb_Side:=host
 include ../../../config_host.mk
 endif
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'feature/tiled-editing' - android/experimental

2015-03-30 Thread Tomaž Vajngerl
 
android/experimental/LOAndroid3/src/java/org/libreoffice/canvas/GraphicSelection.java
 |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit c117d543275a3fffe989d50b68eafcea9d706416
Author: Tomaž Vajngerl tomaz.vajng...@collabora.co.uk
Date:   Tue Mar 31 12:17:40 2015 +0900

android: fix sending graphic selection type to LOKitThread

Change-Id: I42a23f3867acb9632cc94d84e2a4267415e908bc

diff --git 
a/android/experimental/LOAndroid3/src/java/org/libreoffice/canvas/GraphicSelection.java
 
b/android/experimental/LOAndroid3/src/java/org/libreoffice/canvas/GraphicSelection.java
index 1a237a9..49bec56 100644
--- 
a/android/experimental/LOAndroid3/src/java/org/libreoffice/canvas/GraphicSelection.java
+++ 
b/android/experimental/LOAndroid3/src/java/org/libreoffice/canvas/GraphicSelection.java
@@ -230,7 +230,7 @@ public class GraphicSelection implements CanvasElement {
 // Position is in screen coordinates. We need to convert them to
 // document coordinates.
 PointF documentPoint = 
layerView.getLayerClient().convertViewPointToLayerPoint(screenPosition);
-LOKitShell.sendTouchEvent(GraphicSelectionEnd, documentPoint);
+LOKitShell.sendTouchEvent(type, documentPoint);
 }
 }
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'feature/tiled-editing' - android/experimental

2015-03-30 Thread Tomaž Vajngerl
 
android/experimental/LOAndroid3/src/java/org/libreoffice/LOKitInputConnectionHandler.java
   |6 --
 
android/experimental/LOAndroid3/src/java/org/libreoffice/canvas/GraphicSelection.java
   |6 +++---
 
android/experimental/LOAndroid3/src/java/org/libreoffice/canvas/GraphicSelectionHandle.java
 |4 ++--
 3 files changed, 9 insertions(+), 7 deletions(-)

New commits:
commit 1fc402b4fbc2dfa70525ae9b70c95f00e33d1d76
Author: Tomaž Vajngerl tomaz.vajng...@collabora.co.uk
Date:   Tue Mar 31 13:24:32 2015 +0900

android: minor comments change

Change-Id: Ib6522079f95fcf3f00212f848646c5cecfdfc296

diff --git 
a/android/experimental/LOAndroid3/src/java/org/libreoffice/LOKitInputConnectionHandler.java
 
b/android/experimental/LOAndroid3/src/java/org/libreoffice/LOKitInputConnectionHandler.java
index 6e82692..804e726 100644
--- 
a/android/experimental/LOAndroid3/src/java/org/libreoffice/LOKitInputConnectionHandler.java
+++ 
b/android/experimental/LOAndroid3/src/java/org/libreoffice/LOKitInputConnectionHandler.java
@@ -15,7 +15,8 @@ import android.view.inputmethod.InputConnection;
 import org.mozilla.gecko.gfx.InputConnectionHandler;
 
 /**
- * Implementation of InputConnectionHandler.When a key event happens it is 
directed to this class which is then directed further to LOKitThread.
+ * Implementation of InputConnectionHandler. When a key event happens it is
+ * directed to this class which is then directed further to LOKitThread.
  */
 public class LOKitInputConnectionHandler implements InputConnectionHandler {
 private static String LOGTAG = 
LOKitInputConnectionHandler.class.getSimpleName();
@@ -52,7 +53,8 @@ public class LOKitInputConnectionHandler implements 
InputConnectionHandler {
 }
 
 /**
- * When key multiple event happens. Key multiple event is triggered when 
non-ascii characters are entered on soft keyboard
+ * When key multiple event happens. Key multiple event is triggered when
+ * non-ascii characters are entered on soft keyboard.
  */
 @Override
 public boolean onKeyMultiple(int keyCode, int repeatCount, KeyEvent event) 
{
diff --git 
a/android/experimental/LOAndroid3/src/java/org/libreoffice/canvas/GraphicSelection.java
 
b/android/experimental/LOAndroid3/src/java/org/libreoffice/canvas/GraphicSelection.java
index 3fa4619..fbccf1d 100644
--- 
a/android/experimental/LOAndroid3/src/java/org/libreoffice/canvas/GraphicSelection.java
+++ 
b/android/experimental/LOAndroid3/src/java/org/libreoffice/canvas/GraphicSelection.java
@@ -214,7 +214,7 @@ public class GraphicSelection implements CanvasElement {
 }
 
 /**
- * Send graphic selection start event to LOKitTread
+ * Send graphic selection start event to LOKitTread.
  * @param screenPosition - screen position of the selection
  */
 private void sendGraphicSelectionStart(PointF screenPosition) {
@@ -222,7 +222,7 @@ public class GraphicSelection implements CanvasElement {
 }
 
 /**
- * Send graphic selection end event to LOKitTread
+ * Send graphic selection end event to LOKitTread.
  * @param screenPosition - screen position of the selection
  */
 private void sendGraphicSelectionEnd(PointF screenPosition) {
@@ -230,7 +230,7 @@ public class GraphicSelection implements CanvasElement {
 }
 
 /**
- * Send graphic selection event to LOKitTread
+ * Send graphic selection event to LOKitTread.
  * @param type - type of the graphic selection
  * @param screenPosition - screen position of the selection
  */
diff --git 
a/android/experimental/LOAndroid3/src/java/org/libreoffice/canvas/GraphicSelectionHandle.java
 
b/android/experimental/LOAndroid3/src/java/org/libreoffice/canvas/GraphicSelectionHandle.java
index 13487f6..2c9f7ed 100644
--- 
a/android/experimental/LOAndroid3/src/java/org/libreoffice/canvas/GraphicSelectionHandle.java
+++ 
b/android/experimental/LOAndroid3/src/java/org/libreoffice/canvas/GraphicSelectionHandle.java
@@ -58,7 +58,7 @@ public class GraphicSelectionHandle implements CanvasElement {
 }
 
 /**
- * The position of the handle
+ * The position of the handle.
  * @return
  */
 public HandlePosition getHandlePosition() {
@@ -80,7 +80,7 @@ public class GraphicSelectionHandle implements CanvasElement {
 }
 
 /**
- * Draw a filled and stroked circle to the canvas
+ * Draw a filled and stroked circle to the canvas.
  */
 private void drawFilledCircle(Canvas canvas, float x, float y, float 
radius, Paint strokePaint, Paint fillPaint) {
 canvas.drawCircle(x, y, radius, fillPaint);
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'feature/tiled-editing' - android/experimental

2015-03-30 Thread Tomaž Vajngerl
 
android/experimental/LOAndroid3/src/java/org/libreoffice/canvas/GraphicSelection.java
   |   23 +++---
 
android/experimental/LOAndroid3/src/java/org/libreoffice/canvas/GraphicSelectionHandle.java
 |9 +++
 2 files changed, 24 insertions(+), 8 deletions(-)

New commits:
commit 4b1f357108057bb1f2673c64fd27341f8be479d7
Author: Tomaž Vajngerl tomaz.vajng...@collabora.co.uk
Date:   Tue Mar 31 13:16:44 2015 +0900

android: enable AA for selections and handles, tune colors  alpha

Change-Id: Ieea5b084ce1b9550d202bff795d89929632cb724

diff --git 
a/android/experimental/LOAndroid3/src/java/org/libreoffice/canvas/GraphicSelection.java
 
b/android/experimental/LOAndroid3/src/java/org/libreoffice/canvas/GraphicSelection.java
index 49bec56..3fa4619 100644
--- 
a/android/experimental/LOAndroid3/src/java/org/libreoffice/canvas/GraphicSelection.java
+++ 
b/android/experimental/LOAndroid3/src/java/org/libreoffice/canvas/GraphicSelection.java
@@ -24,7 +24,8 @@ import static 
org.libreoffice.canvas.GraphicSelectionHandle.HandlePosition;
  * rectangle.
  */
 public class GraphicSelection implements CanvasElement {
-private final Paint mPaint;
+private final Paint mPaintStroke;
+private final Paint mPaintFill;
 public RectF mRectangle = new RectF();
 public RectF mScaledRectangle = new RectF();
 private RectF mDrawRectangle = new RectF();
@@ -39,10 +40,17 @@ public class GraphicSelection implements CanvasElement {
  */
 public GraphicSelection() {
 // Create the paint, which is needed at drawing
-mPaint = new Paint();
-mPaint.setStyle(Paint.Style.STROKE);
-mPaint.setColor(Color.BLACK);
-mPaint.setStrokeWidth(2);
+mPaintStroke = new Paint();
+mPaintStroke.setStyle(Paint.Style.STROKE);
+mPaintStroke.setColor(Color.GRAY);
+mPaintStroke.setStrokeWidth(2);
+mPaintStroke.setAntiAlias(true);
+
+mPaintFill = new Paint();
+mPaintFill.setStyle(Paint.Style.FILL);
+mPaintFill.setColor(Color.WHITE);
+mPaintFill.setAlpha(200);
+mPaintFill.setAntiAlias(true);
 
 // Create the handles of the selection
 mHandles[0] = new GraphicSelectionHandle(HandlePosition.TOP_LEFT);
@@ -95,7 +103,10 @@ public class GraphicSelection implements CanvasElement {
  */
 @Override
 public void draw(Canvas canvas) {
-canvas.drawRect(mDrawRectangle, mPaint);
+canvas.drawRect(mDrawRectangle, mPaintStroke);
+if (mType != DragType.NONE) {
+canvas.drawRect(mDrawRectangle, mPaintFill);
+}
 for (GraphicSelectionHandle handle : mHandles) {
 handle.draw(canvas);
 }
diff --git 
a/android/experimental/LOAndroid3/src/java/org/libreoffice/canvas/GraphicSelectionHandle.java
 
b/android/experimental/LOAndroid3/src/java/org/libreoffice/canvas/GraphicSelectionHandle.java
index 52b662e..13487f6 100644
--- 
a/android/experimental/LOAndroid3/src/java/org/libreoffice/canvas/GraphicSelectionHandle.java
+++ 
b/android/experimental/LOAndroid3/src/java/org/libreoffice/canvas/GraphicSelectionHandle.java
@@ -42,14 +42,19 @@ public class GraphicSelectionHandle implements 
CanvasElement {
 mHandlePosition = position;
 
 mStrokePaint.setStyle(Paint.Style.STROKE);
-mStrokePaint.setColor(Color.BLACK);
+mStrokePaint.setColor(Color.GRAY);
 mStrokePaint.setStrokeWidth(3);
+mStrokePaint.setAntiAlias(true);
 
 mFillPaint.setStyle(Paint.Style.FILL);
 mFillPaint.setColor(Color.WHITE);
+mFillPaint.setAlpha(200);
+mFillPaint.setAntiAlias(true);
 
 mSelectedFillPaint.setStyle(Paint.Style.FILL);
-mSelectedFillPaint.setColor(Color.BLUE);
+mSelectedFillPaint.setColor(Color.GRAY);
+mSelectedFillPaint.setAlpha(200);
+mSelectedFillPaint.setAntiAlias(true);
 }
 
 /**
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'feature/tiled-editing' - android/experimental

2015-03-27 Thread Miklos Vajna
 android/experimental/LOAndroid3/AndroidManifest.xml.in 
   |1 +
 
android/experimental/LOAndroid3/src/java/org/libreoffice/LibreOfficeMainActivity.java
 |9 -
 2 files changed, 9 insertions(+), 1 deletion(-)

New commits:
commit 9d8fe49d03ec71c83c90d1670d777af63e4bcba3
Author: Miklos Vajna vmik...@collabora.co.uk
Date:   Fri Mar 27 15:18:06 2015 +0100

android: open csv files in Calc

Change-Id: I17b9c4f9d40db46fe6f1be8f1a3ecaee4946454c

diff --git a/android/experimental/LOAndroid3/AndroidManifest.xml.in 
b/android/experimental/LOAndroid3/AndroidManifest.xml.in
index e151172..040246da 100644
--- a/android/experimental/LOAndroid3/AndroidManifest.xml.in
+++ b/android/experimental/LOAndroid3/AndroidManifest.xml.in
@@ -77,6 +77,7 @@
 
 !-- OTHER --
 data android:mimeType=text/csv/
+data android:mimeType=text/comma-separated-values/
 data android:mimeType=application/vnd.ms-works /
 data android:mimeType=application/vnd.apple.keynote /
 data android:mimeType=application/x-abiword /
diff --git 
a/android/experimental/LOAndroid3/src/java/org/libreoffice/LibreOfficeMainActivity.java
 
b/android/experimental/LOAndroid3/src/java/org/libreoffice/LibreOfficeMainActivity.java
index c054143..c169d8e 100644
--- 
a/android/experimental/LOAndroid3/src/java/org/libreoffice/LibreOfficeMainActivity.java
+++ 
b/android/experimental/LOAndroid3/src/java/org/libreoffice/LibreOfficeMainActivity.java
@@ -171,7 +171,14 @@ public class LibreOfficeMainActivity extends 
ActionBarActivity {
 InputStream inputStream = null;
 try {
 inputStream = 
contentResolver.openInputStream(getIntent().getData());
-mTempFile = File.createTempFile(LibreOffice, null, 
this.getCacheDir());
+
+// CSV files need a .csv suffix to be opened in Calc.
+String suffix = null;
+String intentType = getIntent().getType();
+// K-9 mail uses the first, GMail uses the second variant.
+if (text/comma-separated-values.equals(intentType) || 
text/csv.equals(intentType))
+suffix = .csv;
+mTempFile = File.createTempFile(LibreOffice, suffix, 
this.getCacheDir());
 
 OutputStream outputStream = new FileOutputStream(mTempFile);
 byte[] buffer = new byte[4096];
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'feature/tiled-editing' - android/experimental

2015-03-27 Thread Tomaž Vajngerl
 
android/experimental/LOAndroid3/src/java/org/libreoffice/canvas/GraphicSelection.java
   |  106 +++---
 
android/experimental/LOAndroid3/src/java/org/libreoffice/canvas/GraphicSelectionHandle.java
 |   48 
 
android/experimental/LOAndroid3/src/java/org/libreoffice/overlay/TextCursorView.java
|   39 +++
 android/experimental/LOAndroid3/src/java/org/mozilla/gecko/TextSelection.java  
 |5 
 4 files changed, 167 insertions(+), 31 deletions(-)

New commits:
commit b91088c41ed421de068628ee8be1b446930069f2
Author: Tomaž Vajngerl tomaz.vajng...@collabora.co.uk
Date:   Fri Mar 27 22:13:50 2015 +0900

android: comment selection related code, rearrange and clean-up

Change-Id: I18c8c4864d074662f85fc5b0e43eb84cc0638fd8

diff --git 
a/android/experimental/LOAndroid3/src/java/org/libreoffice/canvas/GraphicSelection.java
 
b/android/experimental/LOAndroid3/src/java/org/libreoffice/canvas/GraphicSelection.java
index 4439bad..1a237a9 100644
--- 
a/android/experimental/LOAndroid3/src/java/org/libreoffice/canvas/GraphicSelection.java
+++ 
b/android/experimental/LOAndroid3/src/java/org/libreoffice/canvas/GraphicSelection.java
@@ -34,12 +34,17 @@ public class GraphicSelection implements CanvasElement {
 private GraphicSelectionHandle mHandles[] = new GraphicSelectionHandle[8];
 private GraphicSelectionHandle mDragHandle = null;
 
+/**
+ * Construct the graphic selection.
+ */
 public GraphicSelection() {
+// Create the paint, which is needed at drawing
 mPaint = new Paint();
 mPaint.setStyle(Paint.Style.STROKE);
 mPaint.setColor(Color.BLACK);
 mPaint.setStrokeWidth(2);
 
+// Create the handles of the selection
 mHandles[0] = new GraphicSelectionHandle(HandlePosition.TOP_LEFT);
 mHandles[1] = new GraphicSelectionHandle(HandlePosition.TOP);
 mHandles[2] = new GraphicSelectionHandle(HandlePosition.TOP_RIGHT);
@@ -50,10 +55,15 @@ public class GraphicSelection implements CanvasElement {
 mHandles[7] = new GraphicSelectionHandle(HandlePosition.BOTTOM_RIGHT);
 }
 
+/**
+ * Viewport has changed, reposition the selection to the new rectangle.
+ * @param scaledRectangle - rectangle of selection position on the document
+ */
 public void reposition(RectF scaledRectangle) {
 mScaledRectangle = scaledRectangle;
-mDrawRectangle = scaledRectangle;
+mDrawRectangle = scaledRectangle; // rectangle that will be draw
 
+// reposition the handles too
 mHandles[0].reposition(scaledRectangle.left, scaledRectangle.top);
 mHandles[1].reposition(scaledRectangle.centerX(), scaledRectangle.top);
 mHandles[2].reposition(scaledRectangle.right, scaledRectangle.top);
@@ -64,6 +74,10 @@ public class GraphicSelection implements CanvasElement {
 mHandles[7].reposition(scaledRectangle.right, scaledRectangle.bottom);
 }
 
+/**
+ * Hit test for the selection.
+ * @see org.libreoffice.canvas.CanvasElement#draw(android.graphics.Canvas)
+ */
 @Override
 public boolean contains(float x, float y) {
 // Check if handle was hit
@@ -76,6 +90,7 @@ public class GraphicSelection implements CanvasElement {
 }
 
 /**
+ * Draw the selection on the canvas.
  * @see org.libreoffice.canvas.CanvasElement#draw(android.graphics.Canvas)
  */
 @Override
@@ -86,6 +101,10 @@ public class GraphicSelection implements CanvasElement {
 }
 }
 
+/**
+ * Dragging on the screen has started.
+ * @param position - position where the dragging started
+ */
 public void dragStart(PointF position) {
 mDragHandle = null;
 mType = DragType.NONE;
@@ -105,6 +124,10 @@ public class GraphicSelection implements CanvasElement {
 mStartDragPosition = position;
 }
 
+/**
+ * Dragging is in process.
+ * @param position - position of the drag
+ */
 public void dragging(PointF position) {
 if (mType == DragType.MOVE) {
 float deltaX = position.x - mStartDragPosition.x;
@@ -117,6 +140,34 @@ public class GraphicSelection implements CanvasElement {
 }
 }
 
+/**
+ * Dragging has ended.
+ * @param position - last position of the drag
+ */
+public void dragEnd(PointF position) {
+PointF point = new PointF();
+if (mDragHandle != null) {
+point.x = mDragHandle.mPosition.x;
+point.y = mDragHandle.mPosition.y;
+mDragHandle.reset();
+mDragHandle = null;
+} else {
+point.x = mStartDragPosition.x;
+point.y = mStartDragPosition.y;
+}
+float deltaX = position.x - mStartDragPosition.x;
+float deltaY = position.y - mStartDragPosition.y;
+point.offset(deltaX, deltaY);
+
+sendGraphicSelectionEnd(point);
+
+mDrawRectangle = mScaledRectangle;
+mType = 

[Libreoffice-commits] core.git: Branch 'feature/tiled-editing' - android/experimental

2015-03-25 Thread Jack Leigh
 android/experimental/LOAndroid3/res/menu/view_menu.xml |9 ++---
 1 file changed, 6 insertions(+), 3 deletions(-)

New commits:
commit 45f9c8465a110edf8cd94a6ef2ce89fdfe660121
Author: Jack Leigh jack.le...@collabora.com
Date:   Sun Mar 22 16:49:39 2015 +

android: Get search button to show again

Even though it doesn't work...

Change-Id: Ia84da613fd1e5cb3b2c9c5fa3d0458056b9cb728
Reviewed-on: https://gerrit.libreoffice.org/14950
Reviewed-by: Tomaž Vajngerl qui...@gmail.com
Tested-by: Tomaž Vajngerl qui...@gmail.com

diff --git a/android/experimental/LOAndroid3/res/menu/view_menu.xml 
b/android/experimental/LOAndroid3/res/menu/view_menu.xml
index f316f5a..81a3aa5 100644
--- a/android/experimental/LOAndroid3/res/menu/view_menu.xml
+++ b/android/experimental/LOAndroid3/res/menu/view_menu.xml
@@ -1,8 +1,11 @@
 ?xml version=1.0 encoding=utf-8?
-menu xmlns:android=http://schemas.android.com/apk/res/android;
+menu xmlns:android=http://schemas.android.com/apk/res/android;
+xmlns:app=http://schemas.android.com/apk/res-auto;
+
 item android:id=@+id/menu_search
-  android:icon=@drawable/action_search_light
-  android:showAsAction=always /
+  android:icon=@drawable/action_search
+  app:showAsAction=always /
+
 item android:id=@+id/menu_view_toggle
   android:title=@string/grid_view/
 item android:id=@+id/menu_sort_size
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'feature/tiled-editing' - android/experimental

2015-03-25 Thread Tomaž Vajngerl
 android/experimental/LOAndroid3/res/layout/text_selection_handles.xml |   46 
+-
 1 file changed, 25 insertions(+), 21 deletions(-)

New commits:
commit 8618bd3729c7969e4c97c410e6140477ea567b52
Author: Tomaž Vajngerl tomaz.vajng...@collabora.co.uk
Date:   Wed Mar 25 17:00:45 2015 +0900

android: fix wrong TextCursorView class name, format xml

Change-Id: I54d68cd5ba17bae675c8da421f2e661ac20abe77

diff --git 
a/android/experimental/LOAndroid3/res/layout/text_selection_handles.xml 
b/android/experimental/LOAndroid3/res/layout/text_selection_handles.xml
index 122d1b8..0ee1048 100644
--- a/android/experimental/LOAndroid3/res/layout/text_selection_handles.xml
+++ b/android/experimental/LOAndroid3/res/layout/text_selection_handles.xml
@@ -6,29 +6,33 @@
 merge xmlns:android=http://schemas.android.com/apk/res/android;
xmlns:gecko=http://schemas.android.com/apk/res-auto;
 
-org.mozilla.gecko.TextSelectionHandle android:id=@+id/start_handle
-   
android:layout_width=@dimen/text_selection_handle_width
-   
android:layout_height=@dimen/text_selection_handle_height
-   
android:src=@drawable/handle_start_level
-   android:visibility=gone
-   gecko:handleType=start/
+org.mozilla.gecko.TextSelectionHandle
+android:id=@+id/start_handle
+android:layout_width=@dimen/text_selection_handle_width
+android:layout_height=@dimen/text_selection_handle_height
+android:src=@drawable/handle_start_level
+android:visibility=gone
+gecko:handleType=start/
 
-org.mozilla.gecko.TextSelectionHandle android:id=@+id/middle_handle
-   
android:layout_width=@dimen/text_selection_handle_width
-   
android:layout_height=@dimen/text_selection_handle_height
-   
android:src=@drawable/handle_middle
-   android:visibility=gone
-   gecko:handleType=middle/
+org.mozilla.gecko.TextSelectionHandle
+android:id=@+id/middle_handle
+android:layout_width=@dimen/text_selection_handle_width
+android:layout_height=@dimen/text_selection_handle_height
+android:src=@drawable/handle_middle
+android:visibility=gone
+gecko:handleType=middle/
 
-org.mozilla.gecko.TextSelectionHandle android:id=@+id/end_handle
-   
android:layout_width=@dimen/text_selection_handle_width
-   
android:layout_height=@dimen/text_selection_handle_height
-   
android:src=@drawable/handle_end_level
-   android:visibility=gone
-   gecko:handleType=end/
+org.mozilla.gecko.TextSelectionHandle
+android:id=@+id/end_handle
+android:layout_width=@dimen/text_selection_handle_width
+android:layout_height=@dimen/text_selection_handle_height
+android:src=@drawable/handle_end_level
+android:visibility=gone
+gecko:handleType=end/
 
-org.libreoffice.TextCursorView android:id=@+id/text_cursor_view
-android:layout_width=fill_parent
-android:layout_height=fill_parent/
+org.libreoffice.overlay.TextCursorView
+android:id=@+id/text_cursor_view
+android:layout_width=fill_parent
+android:layout_height=fill_parent/
 
 /merge
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'feature/tiled-editing' - android/experimental

2015-03-25 Thread Jack Leigh
 android/experimental/LOAndroid3/res/layout/activity_document_browser.xml   
|   36 ++
 android/experimental/LOAndroid3/res/layout/file_grid.xml   
|   20 +
 android/experimental/LOAndroid3/res/layout/file_list.xml   
|   20 +
 android/experimental/LOAndroid3/res/values-v21/themes.xml  
|   10 ++
 android/experimental/LOAndroid3/res/values/themes.xml  
|2 
 
android/experimental/LOAndroid3/src/java/org/libreoffice/ui/LibreOfficeUIActivity.java
 |   12 ++-
 6 files changed, 64 insertions(+), 36 deletions(-)

New commits:
commit 291f766d1ab276d4ae8146e666b45bf3e3e8035d
Author: Jack Leigh jack.le...@collabora.com
Date:   Fri Mar 20 16:14:19 2015 +

android: Migrate to Toolbar in file browser

Change-Id: Ib5e3d0d39268437c179973ba4e785a719cdc351a
Reviewed-on: https://gerrit.libreoffice.org/14949
Reviewed-by: Tomaž Vajngerl qui...@gmail.com
Tested-by: Tomaž Vajngerl qui...@gmail.com

diff --git 
a/android/experimental/LOAndroid3/res/layout/activity_document_browser.xml 
b/android/experimental/LOAndroid3/res/layout/activity_document_browser.xml
new file mode 100644
index 000..f54591b
--- /dev/null
+++ b/android/experimental/LOAndroid3/res/layout/activity_document_browser.xml
@@ -0,0 +1,36 @@
+?xml version=1.0 encoding=utf-8?
+!--
+ This file is part of the LibreOffice project.
+
+ This Source Code Form is subject to the terms of the Mozilla Public
+ License, v. 2.0. If a copy of the MPL was not distributed with this
+ file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ --
+android.support.v4.widget.DrawerLayout
+xmlns:android=http://schemas.android.com/apk/res/android;
+android:id=@+id/drawer_layout
+android:layout_width=match_parent
+android:layout_height=match_parent
+
+!-- The content --
+LinearLayout xmlns:android=http://schemas.android.com/apk/res/android;
+android:id=@+id/browser_main_content
+android:layout_width=match_parent
+android:layout_height=match_parent
+android:orientation=vertical 
+
+include layout=@layout/toolbar/
+
+/LinearLayout
+
+!-- The navigation drawer --
+ListView android:id=@+id/left_drawer
+android:layout_width=240dp
+android:layout_height=match_parent
+android:layout_gravity=start
+android:choiceMode=singleChoice
+android:divider=@android:color/transparent
+android:dividerHeight=0dp
+android:background=#111/
+
+/android.support.v4.widget.DrawerLayout
diff --git a/android/experimental/LOAndroid3/res/layout/file_grid.xml 
b/android/experimental/LOAndroid3/res/layout/file_grid.xml
index ec7fdd0..1885bd3 100644
--- a/android/experimental/LOAndroid3/res/layout/file_grid.xml
+++ b/android/experimental/LOAndroid3/res/layout/file_grid.xml
@@ -5,13 +5,11 @@
  License, v. 2.0. If a copy of the MPL was not distributed with this
  file, You can obtain one at http://mozilla.org/MPL/2.0/.
  --
-android.support.v4.widget.DrawerLayout
-xmlns:android=http://schemas.android.com/apk/res/android;
-android:id=@+id/drawer_layout
+LinearLayout xmlns:android=http://schemas.android.com/apk/res/android;
 android:layout_width=match_parent
-android:layout_height=match_parent
+android:layout_height=match_parent
+android:orientation=vertical 
 
-!-- The main content view --
 GridView
 android:id=@+id/file_explorer_grid_view
 android:layout_width=fill_parent
@@ -24,14 +22,4 @@
 android:gravity=center
 /GridView
 
-!-- The navigation drawer --
-ListView android:id=@+id/left_drawer
-android:layout_width=240dp
-android:layout_height=match_parent
-android:layout_gravity=start
-android:choiceMode=singleChoice
-android:divider=@android:color/transparent
-android:dividerHeight=0dp
-android:background=#111/
-
-/android.support.v4.widget.DrawerLayout
+/LinearLayout
diff --git a/android/experimental/LOAndroid3/res/layout/file_list.xml 
b/android/experimental/LOAndroid3/res/layout/file_list.xml
index dd5346f..48dfb1e 100644
--- a/android/experimental/LOAndroid3/res/layout/file_list.xml
+++ b/android/experimental/LOAndroid3/res/layout/file_list.xml
@@ -6,27 +6,15 @@
  License, v. 2.0. If a copy of the MPL was not distributed with this
  file, You can obtain one at http://mozilla.org/MPL/2.0/.
  --
-android.support.v4.widget.DrawerLayout
-xmlns:android=http://schemas.android.com/apk/res/android;
-android:id=@+id/drawer_layout
+LinearLayout xmlns:android=http://schemas.android.com/apk/res/android;
 android:layout_width=match_parent
-android:layout_height=match_parent
+android:layout_height=match_parent
+android:orientation=vertical 
 
-!-- The main content view --
 ListView
 android:id=@+id/file_explorer_list_view
 

[Libreoffice-commits] core.git: Branch 'feature/tiled-editing' - android/experimental

2015-03-19 Thread Miklos Vajna
 
android/experimental/LOAndroid3/src/java/org/libreoffice/InvalidationHandler.java
 |5 -
 1 file changed, 4 insertions(+), 1 deletion(-)

New commits:
commit 2dad7eb36753f9c84bfcc20c456e33104be06482
Author: Miklos Vajna vmik...@collabora.co.uk
Date:   Thu Mar 19 17:53:38 2015 +0100

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

diff --git 
a/android/experimental/LOAndroid3/src/java/org/libreoffice/InvalidationHandler.java
 
b/android/experimental/LOAndroid3/src/java/org/libreoffice/InvalidationHandler.java
index e9110f6..805ed9c 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);
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'feature/tiled-editing' - android/experimental

2015-03-18 Thread Tomaž Vajngerl
 
android/experimental/LOAndroid3/src/java/org/libreoffice/DrawElementHandle.java 
|   33 ++-
 android/experimental/LOAndroid3/src/java/org/libreoffice/TextCursorView.java   
 |  107 +++---
 2 files changed, 110 insertions(+), 30 deletions(-)

New commits:
commit 4b8120b058c03a4385ed211161e793071c117d7d
Author: Tomaž Vajngerl tomaz.vajng...@collabora.co.uk
Date:   Wed Mar 18 18:12:02 2015 +0900

android: Hit test for handles, show resize rect

Change-Id: Ibf9f98968fd9007be6dc5481d1652923ecb98b89

diff --git 
a/android/experimental/LOAndroid3/src/java/org/libreoffice/DrawElementHandle.java
 
b/android/experimental/LOAndroid3/src/java/org/libreoffice/DrawElementHandle.java
index 1af0724..7968b31 100644
--- 
a/android/experimental/LOAndroid3/src/java/org/libreoffice/DrawElementHandle.java
+++ 
b/android/experimental/LOAndroid3/src/java/org/libreoffice/DrawElementHandle.java
@@ -12,28 +12,57 @@ import android.graphics.Canvas;
 import android.graphics.Color;
 import android.graphics.Paint;
 import android.graphics.PointF;
+import android.graphics.RectF;
 
+import org.mozilla.gecko.gfx.RectUtils;
+
+/**
+ * This class is responsible to draw the selection handles, track the handle
+ * position and perform a hit test to determine if the selection handle was
+ * touched.
+ */
 public class DrawElementHandle {
 public PointF mPosition = new PointF();
 private float mRadius = 20.0f;
 private Paint mGraphicHandleFillPaint = new Paint();
 private Paint mGraphicSelectionPaint = new Paint();
+private Paint mGraphicHandleSelectedFillPaint = new Paint();
+private RectF mHitRect = new RectF();
 
 public DrawElementHandle(Paint graphicSelectionPaint) {
 mGraphicSelectionPaint = graphicSelectionPaint;
 
 mGraphicHandleFillPaint.setStyle(Paint.Style.FILL);
 mGraphicHandleFillPaint.setColor(Color.WHITE);
+
+mGraphicHandleSelectedFillPaint.setStyle(Paint.Style.FILL);
+mGraphicHandleSelectedFillPaint.setColor(Color.BLACK);
 }
 
 public void draw(Canvas canvas) {
-canvas.drawCircle(mPosition.x, mPosition.y, mRadius, 
mGraphicHandleFillPaint);
-canvas.drawCircle(mPosition.x, mPosition.y, mRadius, 
mGraphicSelectionPaint);
+drawFilledCircle(canvas, mPosition.x, mPosition.y, mRadius, 
mGraphicSelectionPaint, mGraphicHandleFillPaint);
+}
+
+public void drawSelected(Canvas canvas) {
+drawFilledCircle(canvas, mPosition.x, mPosition.y, mRadius, 
mGraphicSelectionPaint, mGraphicHandleSelectedFillPaint);
+}
+
+private void drawFilledCircle(Canvas canvas, float x, float y, float 
radius, Paint strokePaint, Paint fillPaint) {
+canvas.drawCircle(x, y, radius, fillPaint);
+canvas.drawCircle(x, y, radius, strokePaint);
 }
 
 public void reposition(float x, float y) {
 mPosition.x = x;
 mPosition.y = y;
+mHitRect.left = mPosition.x - mRadius * 2;
+mHitRect.right = mPosition.x + mRadius * 2;
+mHitRect.top = mPosition.y - mRadius * 2;
+mHitRect.bottom = mPosition.y + mRadius * 2;
+}
+
+public boolean contains(float x, float y) {
+return mHitRect.contains(x, y);
 }
 }
 
diff --git 
a/android/experimental/LOAndroid3/src/java/org/libreoffice/TextCursorView.java 
b/android/experimental/LOAndroid3/src/java/org/libreoffice/TextCursorView.java
index c9ecabb..26eb215 100644
--- 
a/android/experimental/LOAndroid3/src/java/org/libreoffice/TextCursorView.java
+++ 
b/android/experimental/LOAndroid3/src/java/org/libreoffice/TextCursorView.java
@@ -52,7 +52,6 @@ public class TextCursorView extends View implements 
View.OnTouchListener {
 private RectF mGraphicScaledSelection = new RectF();
 private Paint mGraphicSelectionPaint = new Paint();
 
-
 private boolean mGraphicSelectionVisible;
 private PointF mTouchStart = new PointF();
 private PointF mDeltaPoint = new PointF();
@@ -60,6 +59,7 @@ public class TextCursorView extends View implements 
View.OnTouchListener {
 private LayerView mLayerView;
 
 private DrawElementHandle mHandles[] = new DrawElementHandle[8];
+private DrawElementHandle mDragHandle = null;
 
 public TextCursorView(Context context) {
 super(context);
@@ -189,16 +189,31 @@ public class TextCursorView extends View implements 
View.OnTouchListener {
 }
 }
 if (mGraphicSelectionVisible) {
-canvas.drawRect(mGraphicScaledSelection, mGraphicSelectionPaint);
+if (mGraphicSelectionMove) {
+for (DrawElementHandle handle : mHandles) {
+if (mDragHandle == handle) {
+handle.drawSelected(canvas);
+} else {
+handle.draw(canvas);
+}
+}
 
-for (DrawElementHandle handle : mHandles) {
-handle.draw(canvas);
-}
+RectF selectionRect = new 

[Libreoffice-commits] core.git: Branch 'feature/tiled-editing' - android/experimental

2015-03-17 Thread Miklos Vajna
 android/experimental/LOAndroid3/src/java/com/polites/android/Animation.java
 |   28 
 android/experimental/LOAndroid3/src/java/com/polites/android/Animator.java 
 |   91 -
 
android/experimental/LOAndroid3/src/java/com/polites/android/FlingAnimation.java
|   70 
 
android/experimental/LOAndroid3/src/java/com/polites/android/FlingAnimationListener.java
|   24 
 
android/experimental/LOAndroid3/src/java/com/polites/android/FlingListener.java 
|   40 
 
android/experimental/LOAndroid3/src/java/com/polites/android/GestureImageView.java
  |  712 --
 
android/experimental/LOAndroid3/src/java/com/polites/android/GestureImageViewListener.java
  |   26 
 
android/experimental/LOAndroid3/src/java/com/polites/android/GestureImageViewTouchListener.java
 |  540 ---
 android/experimental/LOAndroid3/src/java/com/polites/android/MathUtils.java
 |   76 -
 
android/experimental/LOAndroid3/src/java/com/polites/android/MoveAnimation.java 
|  102 -
 
android/experimental/LOAndroid3/src/java/com/polites/android/MoveAnimationListener.java
 |   22 
 android/experimental/LOAndroid3/src/java/com/polites/android/VectorF.java  
 |   63 
 
android/experimental/LOAndroid3/src/java/com/polites/android/ZoomAnimation.java 
|  162 --
 
android/experimental/LOAndroid3/src/java/com/polites/android/ZoomAnimationListener.java
 |   21 
 14 files changed, 1977 deletions(-)

New commits:
commit cda4d51580426e5ce4c2787eaa35bb5b14850066
Author: Miklos Vajna vmik...@collabora.co.uk
Date:   Tue Mar 17 09:27:29 2015 +0100

android: clean up no longer needed com.polites library in LOAndroi3

That was something from the other LibreOffice4Android that got merged
with LOAndroid3. The document browser doesn't use it, so we don't need
it anymore.

Change-Id: I5446eb7a0fe6e0de81532e981a0853da16910f54

diff --git 
a/android/experimental/LOAndroid3/src/java/com/polites/android/Animation.java 
b/android/experimental/LOAndroid3/src/java/com/polites/android/Animation.java
deleted file mode 100644
index a0d218b..000
--- 
a/android/experimental/LOAndroid3/src/java/com/polites/android/Animation.java
+++ /dev/null
@@ -1,28 +0,0 @@
-/*
- * Copyright (c) 2012 Jason Polites
- *
- * Licensed under the Apache License, Version 2.0 (the License);
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an AS IS BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package com.polites.android;
-
-public interface Animation {
-
-   /**
-* Transforms the view.
-* @param view
-* @param diffTime
-* @return true if this animation should remain active.  False 
otherwise.
-*/
-   public boolean update(GestureImageView view, long time);
-
-}
diff --git 
a/android/experimental/LOAndroid3/src/java/com/polites/android/Animator.java 
b/android/experimental/LOAndroid3/src/java/com/polites/android/Animator.java
deleted file mode 100644
index 6fc82f1..000
--- a/android/experimental/LOAndroid3/src/java/com/polites/android/Animator.java
+++ /dev/null
@@ -1,91 +0,0 @@
-/*
- * Copyright (c) 2012 Jason Polites
- *
- * Licensed under the Apache License, Version 2.0 (the License);
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an AS IS BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package com.polites.android;
-
-public class Animator extends Thread {
-
-   private GestureImageView view;
-   private Animation animation;
-   private boolean running = false;
-   private boolean active = false;
-   private long lastTime = -1L;
-
-   public Animator(GestureImageView view, String threadName) {
-   super(threadName);
-   this.view = view;
-   }
-
-   @Override
-   public void run() {
-
-   running = true;
-
-   while(running) {
-
-   while(active  animation != null) {
-   long time = System.currentTimeMillis();
-   active = animation.update(view, time - 
lastTime);
-   

[Libreoffice-commits] core.git: Branch 'feature/tiled-editing' - android/experimental

2015-03-16 Thread Tomaž Vajngerl
 
android/experimental/LOAndroid3/src/java/org/libreoffice/InvalidationHandler.java
  |   51 ++
 android/experimental/LOAndroid3/src/java/org/libreoffice/LOEvent.java  
|3 
 
android/experimental/LOAndroid3/src/java/org/libreoffice/LOKitInputConnectionHandler.java
  |   18 ++
 android/experimental/LOAndroid3/src/java/org/libreoffice/LOKitThread.java  
|   49 ++
 
android/experimental/LOAndroid3/src/java/org/libreoffice/LOKitTileProvider.java 
   |   74 +-
 
android/experimental/LOAndroid3/src/java/org/libreoffice/LibreOfficeMainActivity.java
  |3 
 android/experimental/LOAndroid3/src/java/org/libreoffice/TextCursorLayer.java  
|   30 
 android/experimental/LOAndroid3/src/java/org/libreoffice/TileIdentifier.java   
|   12 +
 android/experimental/LOAndroid3/src/java/org/libreoffice/TileProvider.java 
|   15 ++
 
android/experimental/LOAndroid3/src/java/org/libreoffice/TileProviderFactory.java
  |3 
 
android/experimental/LOAndroid3/src/java/org/libreoffice/ToolbarController.java 
   |   11 +
 android/experimental/LOAndroid3/src/java/org/mozilla/gecko/TextSelection.java  
|   23 ++-
 
android/experimental/LOAndroid3/src/java/org/mozilla/gecko/TextSelectionHandle.java
|3 
 
android/experimental/LOAndroid3/src/java/org/mozilla/gecko/gfx/RenderControllerThread.java
 |4 
 14 files changed, 294 insertions(+), 5 deletions(-)

New commits:
commit c184c0c3c1e399a309cbb8cfa333e133d48a44c1
Author: Tomaž Vajngerl tomaz.vajng...@collabora.co.uk
Date:   Tue Mar 17 14:38:49 2015 +0900

android: add comment to many classes and methods

Change-Id: I49d9bd7c702c260ea66ef211edbaf5e106264bb6

diff --git 
a/android/experimental/LOAndroid3/src/java/org/libreoffice/InvalidationHandler.java
 
b/android/experimental/LOAndroid3/src/java/org/libreoffice/InvalidationHandler.java
index d94c93a..6bbe110 100644
--- 
a/android/experimental/LOAndroid3/src/java/org/libreoffice/InvalidationHandler.java
+++ 
b/android/experimental/LOAndroid3/src/java/org/libreoffice/InvalidationHandler.java
@@ -29,6 +29,10 @@ public class InvalidationHandler implements 
Document.MessageCallback {
 mState = OverlayState.NONE;
 }
 
+/**
+ * Sets the tile provider, without this the
+ * @param tileProvider
+ */
 public void setTileProvider(TileProvider tileProvider) {
 mTileProvider = tileProvider;
 }
@@ -244,10 +248,19 @@ public class InvalidationHandler implements 
Document.MessageCallback {
 }
 }
 
+/**
+ * Trigger a transition to a new overlay state.
+ * @param next - new state to transition to
+ */
 public synchronized void changeStateTo(OverlayState next) {
 changeState(mState, next);
 }
 
+/**
+ * Executes a transition from old overlay state to a new overlay state.
+ * @param previous - old state
+ * @param next - new state
+ */
 private synchronized void changeState(OverlayState previous, OverlayState 
next) {
 mState = next;
 handleGeneralChangeState(previous, next);
@@ -270,6 +283,9 @@ public class InvalidationHandler implements 
Document.MessageCallback {
 }
 }
 
+/**
+ * Handle a general transition - executed for all transitions.
+ */
 private void handleGeneralChangeState(OverlayState previous, OverlayState 
next) {
 if (previous == OverlayState.NONE) {
 LOKitShell.getToolbarController().switchToEditMode();
@@ -278,6 +294,9 @@ public class InvalidationHandler implements 
Document.MessageCallback {
 }
 }
 
+/**
+ * Handle a transition to OverlayState.NONE state.
+ */
 private void handleNoneState(OverlayState previous) {
 if (previous == OverlayState.NONE) {
 return;
@@ -293,12 +312,18 @@ public class InvalidationHandler implements 
Document.MessageCallback {
 LibreOfficeMainActivity.mAppContext.hideSoftKeyboard();
 }
 
+/**
+ * Handle a transition to OverlayState.SELECTION state.
+ */
 private void handleSelectionState(OverlayState previous) {
 mTextSelection.showHandle(TextSelectionHandle.HandleType.START);
 mTextSelection.showHandle(TextSelectionHandle.HandleType.END);
 mTextCursorLayer.showSelections();
 }
 
+/**
+ * Handle a transition to OverlayState.CURSOR state.
+ */
 private void handleCursorState(OverlayState previous) {
 LibreOfficeMainActivity.mAppContext.showSoftKeyboard();
 if (previous == OverlayState.TRANSITION) {
@@ -307,6 +332,9 @@ public class InvalidationHandler implements 
Document.MessageCallback {
 }
 }
 
+/**
+ * Handle a transition to OverlayState.TRANSITION state.
+ */
 private void handleTransitionState(OverlayState previous) {
 if (previous == OverlayState.SELECTION) {
 

[Libreoffice-commits] core.git: Branch 'feature/tiled-editing' - android/experimental

2015-03-16 Thread Miklos Vajna
 android/experimental/LOAndroid3/src/java/org/libreoffice/DocumentPartView.java 
   |   10 
 
android/experimental/LOAndroid3/src/java/org/libreoffice/DocumentPartViewListAdapter.java
 |   10 
 android/experimental/LOAndroid3/src/java/org/libreoffice/LOEvent.java  
   |   10 
 
android/experimental/LOAndroid3/src/java/org/libreoffice/LOKitInputConnectionHandler.java
 |   10 
 android/experimental/LOAndroid3/src/java/org/libreoffice/LOKitShell.java   
   |   10 
 
android/experimental/LOAndroid3/src/java/org/libreoffice/LOKitTileProvider.java 
  |   10 +++-
 android/experimental/LOAndroid3/src/java/org/libreoffice/MockTileProvider.java 
   |   10 
 android/experimental/LOAndroid3/src/java/org/libreoffice/TextCursorLayer.java  
   |   10 
 android/experimental/LOAndroid3/src/java/org/libreoffice/TextCursorView.java   
   |   12 +-
 android/experimental/LOAndroid3/src/java/org/libreoffice/ThumbnailCreator.java 
   |   10 
 android/experimental/LOAndroid3/src/java/org/libreoffice/TileIdentifier.java   
   |   12 +-
 android/experimental/LOAndroid3/src/java/org/libreoffice/TileProvider.java 
   |   10 
 
android/experimental/LOAndroid3/src/java/org/libreoffice/TileProviderFactory.java
 |   12 +-
 
android/experimental/LOAndroid3/src/java/org/libreoffice/ToolbarController.java 
  |   10 
 
android/experimental/LOAndroid3/src/java/org/libreoffice/ui/FolderIconView.java 
  |   10 
 
android/experimental/LOAndroid3/src/java/org/mozilla/gecko/OnSlideSwipeListener.java
  |8 +-
 16 files changed, 158 insertions(+), 6 deletions(-)

New commits:
commit 05d81a728e748fd60fd27eeaf8629b547d4d66da
Author: Miklos Vajna vmik...@collabora.co.uk
Date:   Mon Mar 16 09:50:18 2015 +0100

android: add missing license headers and modelines

Change-Id: I66b2fc7ee846d6865b11cf1cbb168a6e5fab2eea

diff --git 
a/android/experimental/LOAndroid3/src/java/org/libreoffice/DocumentPartView.java
 
b/android/experimental/LOAndroid3/src/java/org/libreoffice/DocumentPartView.java
index 768b4af..5f72305 100644
--- 
a/android/experimental/LOAndroid3/src/java/org/libreoffice/DocumentPartView.java
+++ 
b/android/experimental/LOAndroid3/src/java/org/libreoffice/DocumentPartView.java
@@ -1,3 +1,11 @@
+/* -*- Mode: Java; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- 
*/
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ */
 package org.libreoffice;
 
 public class DocumentPartView {
@@ -9,3 +17,5 @@ public class DocumentPartView {
 this.partName = partName;
 }
 }
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git 
a/android/experimental/LOAndroid3/src/java/org/libreoffice/DocumentPartViewListAdapter.java
 
b/android/experimental/LOAndroid3/src/java/org/libreoffice/DocumentPartViewListAdapter.java
index 0dbc9cd..d3292d5 100644
--- 
a/android/experimental/LOAndroid3/src/java/org/libreoffice/DocumentPartViewListAdapter.java
+++ 
b/android/experimental/LOAndroid3/src/java/org/libreoffice/DocumentPartViewListAdapter.java
@@ -1,3 +1,11 @@
+/* -*- Mode: Java; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- 
*/
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ */
 package org.libreoffice;
 
 import android.app.Activity;
@@ -39,3 +47,5 @@ public class DocumentPartViewListAdapter extends 
ArrayAdapterDocumentPartView
 return view;
 }
 }
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git 
a/android/experimental/LOAndroid3/src/java/org/libreoffice/LOEvent.java 
b/android/experimental/LOAndroid3/src/java/org/libreoffice/LOEvent.java
index 4413a63..c163337 100644
--- a/android/experimental/LOAndroid3/src/java/org/libreoffice/LOEvent.java
+++ b/android/experimental/LOAndroid3/src/java/org/libreoffice/LOEvent.java
@@ -1,3 +1,11 @@
+/* -*- Mode: Java; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- 
*/
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ */
 package org.libreoffice;
 
 import android.graphics.PointF;
@@ -106,3 +114,5 @@ public class LOEvent implements ComparableLOEvent {
 }
 
 }
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git 

[Libreoffice-commits] core.git: Branch 'feature/tiled-editing' - android/experimental

2015-03-13 Thread Miklos Vajna
 
android/experimental/LOAndroid3/res/drawable-xxxhdpi/ic_format_keyboard_grey600_24dp.png
 |binary
 android/experimental/LOAndroid3/res/menu/main.xml  
  |6 ++
 android/experimental/LOAndroid3/res/values/strings.xml 
  |1 +
 
android/experimental/LOAndroid3/src/java/org/libreoffice/LibreOfficeMainActivity.java
|3 +++
 4 files changed, 10 insertions(+)

New commits:
commit 9de0f2d63c37f789ffe26d5af2db9d60b58f80f5
Author: Miklos Vajna vmik...@collabora.co.uk
Date:   Fri Mar 13 18:21:30 2015 +0100

android: add toolbar button to force-show the soft keyboard

Change-Id: I1758f4db7b6894df66d721af77092754b0252100

diff --git 
a/android/experimental/LOAndroid3/res/drawable-xxxhdpi/ic_format_keyboard_grey600_24dp.png
 
b/android/experimental/LOAndroid3/res/drawable-xxxhdpi/ic_format_keyboard_grey600_24dp.png
new file mode 100644
index 000..cfad1bed
Binary files /dev/null and 
b/android/experimental/LOAndroid3/res/drawable-xxxhdpi/ic_format_keyboard_grey600_24dp.png
 differ
diff --git a/android/experimental/LOAndroid3/res/menu/main.xml 
b/android/experimental/LOAndroid3/res/menu/main.xml
index 52f4ebc..8670ed3 100644
--- a/android/experimental/LOAndroid3/res/menu/main.xml
+++ b/android/experimental/LOAndroid3/res/menu/main.xml
@@ -10,6 +10,12 @@
   android:orderInCategory=100
   app:showAsAction=always/
 
+item android:id=@+id/action_keyboard
+  android:title=@string/action_keyboard
+  android:icon=@drawable/ic_format_keyboard_grey600_24dp
+  android:orderInCategory=100
+  app:showAsAction=always/
+
 item android:id=@+id/action_about
 android:title=@string/action_about
 android:orderInCategory=100 /
diff --git a/android/experimental/LOAndroid3/res/values/strings.xml 
b/android/experimental/LOAndroid3/res/values/strings.xml
index e2c6ffc..3d8c3aa 100644
--- a/android/experimental/LOAndroid3/res/values/strings.xml
+++ b/android/experimental/LOAndroid3/res/values/strings.xml
@@ -35,5 +35,6 @@
 string name=local_documentsLocal documents/string
 string name=local_file_systemLocal file system/string
 string name=action_boldBold/string
+string name=action_keyboardShow keyboard/string
 
 /resources
diff --git 
a/android/experimental/LOAndroid3/src/java/org/libreoffice/LibreOfficeMainActivity.java
 
b/android/experimental/LOAndroid3/src/java/org/libreoffice/LibreOfficeMainActivity.java
index e1af1e2..48f7850 100644
--- 
a/android/experimental/LOAndroid3/src/java/org/libreoffice/LibreOfficeMainActivity.java
+++ 
b/android/experimental/LOAndroid3/src/java/org/libreoffice/LibreOfficeMainActivity.java
@@ -79,6 +79,9 @@ public class LibreOfficeMainActivity extends 
ActionBarActivity {
 case R.id.action_bold:
 LOKitShell.sendEvent(new LOEvent(LOEvent.UNO_COMMAND, 
.uno:Bold));
 return true;
+case R.id.action_keyboard:
+showSoftKeyboard();
+break;
 case R.id.action_about:
 mAbout.showAbout();
 return true;
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'feature/tiled-editing' - android/experimental

2015-03-13 Thread Miklos Vajna
 
android/experimental/LOAndroid3/src/java/org/libreoffice/InvalidationHandler.java
 |3 +++
 1 file changed, 3 insertions(+)

New commits:
commit def45bf0efaf01294f225228d5c3b3435277ab5b
Author: Miklos Vajna vmik...@collabora.co.uk
Date:   Fri Mar 13 12:37:30 2015 +0100

android: also hide keyboard on graphic selection

Change-Id: I597f7099405a244f54966c203483dfda22cfbcc9

diff --git 
a/android/experimental/LOAndroid3/src/java/org/libreoffice/InvalidationHandler.java
 
b/android/experimental/LOAndroid3/src/java/org/libreoffice/InvalidationHandler.java
index 1ac35d9..22aeda3 100644
--- 
a/android/experimental/LOAndroid3/src/java/org/libreoffice/InvalidationHandler.java
+++ 
b/android/experimental/LOAndroid3/src/java/org/libreoffice/InvalidationHandler.java
@@ -321,6 +321,7 @@ public class InvalidationHandler implements 
Document.MessageCallback {
 
 private void handleGraphicSelectionState(OverlayState previous) {
 mTextCursorLayer.showGraphicSelection();
+LibreOfficeMainActivity.mAppContext.hideSoftKeyboard();
 }
 
 public OverlayState getCurrentState() {
@@ -335,3 +336,5 @@ public class InvalidationHandler implements 
Document.MessageCallback {
 SELECTION
 }
 }
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'feature/tiled-editing' - android/experimental

2015-03-13 Thread Miklos Vajna
 
android/experimental/LOAndroid3/src/java/org/mozilla/gecko/gfx/ScrollbarLayer.java
 |8 
 1 file changed, 8 insertions(+)

New commits:
commit 78a418ea1e37c34513887974a51d46e0d9435ff6
Author: Miklos Vajna vmik...@collabora.co.uk
Date:   Fri Mar 13 12:13:19 2015 +0100

android: hide soft keyboard when scrolling

Change-Id: Ia840cd68d7af7a6948ad5766b56a3dc27cb8795b

diff --git 
a/android/experimental/LOAndroid3/src/java/org/mozilla/gecko/gfx/ScrollbarLayer.java
 
b/android/experimental/LOAndroid3/src/java/org/mozilla/gecko/gfx/ScrollbarLayer.java
index ddd4a0a..589bc7a 100644
--- 
a/android/experimental/LOAndroid3/src/java/org/mozilla/gecko/gfx/ScrollbarLayer.java
+++ 
b/android/experimental/LOAndroid3/src/java/org/mozilla/gecko/gfx/ScrollbarLayer.java
@@ -13,8 +13,10 @@ import android.graphics.PorterDuff;
 import android.graphics.Rect;
 import android.graphics.RectF;
 import android.opengl.GLES20;
+import android.util.Log;
 
 import org.libreoffice.kit.DirectBufferAllocator;
+import org.libreoffice.LibreOfficeMainActivity;
 import org.mozilla.gecko.util.FloatUtils;
 
 import java.nio.ByteBuffer;
@@ -24,6 +26,7 @@ import java.nio.FloatBuffer;
  * Draws a small rect. This is scaled to become a scrollbar.
  */
 public class ScrollbarLayer extends TileLayer {
+private static String LOGTAG = LayerView.class.getName();
 public static final long FADE_DELAY = 500; // milliseconds before fade-out 
starts
 private static final float FADE_AMOUNT = 0.03f; // how much (as a percent) 
the scrollbar should fade per frame
 
@@ -204,6 +207,9 @@ public class ScrollbarLayer extends TileLayer {
 beginTransaction(); // called on compositor thread
 mOpacity = 1.0f;
 endTransaction();
+
+// Scrollbar is now visible, scrolling will start: hide the soft 
keyboard.
+LibreOfficeMainActivity.mAppContext.hideSoftKeyboard();
 return true;
 }
 
@@ -445,3 +451,5 @@ public class ScrollbarLayer extends TileLayer {
 return new RectF(barStart, bottom - BAR_SIZE, barEnd, bottom);
 }
 }
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'feature/tiled-editing' - android/experimental

2015-03-09 Thread Tomaž Vajngerl
 android/experimental/LOAndroid3/res/values/themes.xml |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit cebd99d5e5a7f94d57a4b1f56124bb62cf294e23
Author: Tomaž Vajngerl tomaz.vajng...@collabora.co.uk
Date:   Tue Mar 10 11:08:19 2015 +0900

android: wrong parent in theme definition

Change-Id: I0efaa8c131959dbaefba24d48041744391c55137

diff --git a/android/experimental/LOAndroid3/res/values/themes.xml 
b/android/experimental/LOAndroid3/res/values/themes.xml
index f0853b8..2d8f593 100644
--- a/android/experimental/LOAndroid3/res/values/themes.xml
+++ b/android/experimental/LOAndroid3/res/values/themes.xml
@@ -1,6 +1,6 @@
 ?xml version=1.0 encoding=utf-8?
 resources
-style name=LibreOfficeTheme parent=LibreOfficeTheme/
+style name=LibreOfficeTheme parent=LibreOfficeTheme.Base/
 
 style name=LibreOfficeTheme.Base parent=Theme.AppCompat.Light
 item name=android:windowNoTitletrue/item
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'feature/tiled-editing' - android/experimental

2015-03-09 Thread Tomaž Vajngerl
 android/experimental/LOAndroid3/res/layout/text_selection_handles.xml |3 
+--
 1 file changed, 1 insertion(+), 2 deletions(-)

New commits:
commit d3e571cc544a57c0655fa8490a9bb6fea9199e89
Author: Tomaž Vajngerl tomaz.vajng...@collabora.co.uk
Date:   Mon Mar 9 16:03:13 2015 +0900

android: don't hide CursorView by default

Change-Id: Ic662d71face370457c122946c8dbcb56d6f2bfe7

diff --git 
a/android/experimental/LOAndroid3/res/layout/text_selection_handles.xml 
b/android/experimental/LOAndroid3/res/layout/text_selection_handles.xml
index 3de21f6..122d1b8 100644
--- a/android/experimental/LOAndroid3/res/layout/text_selection_handles.xml
+++ b/android/experimental/LOAndroid3/res/layout/text_selection_handles.xml
@@ -29,7 +29,6 @@
 
 org.libreoffice.TextCursorView android:id=@+id/text_cursor_view
 android:layout_width=fill_parent
-android:layout_height=fill_parent
-android:visibility=gone/
+android:layout_height=fill_parent/
 
 /merge
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'feature/tiled-editing' - android/experimental include/LibreOfficeKit libreofficekit/source

2015-03-05 Thread Miklos Vajna
 android/experimental/LOAndroid3/res/drawable/handle_graphic.png |binary
 include/LibreOfficeKit/LibreOfficeKitGtk.h  |2 
 libreofficekit/source/gtk/lokdocview.c  |   66 
++
 3 files changed, 68 insertions(+)

New commits:
commit 90468907633c3d5729c42aa294b3e77d0db79206
Author: Miklos Vajna vmik...@collabora.co.uk
Date:   Thu Mar 5 14:15:54 2015 +0100

lokdocview: render graphic selection handles

Change-Id: I8c1331c32baf92b077f45678929df0e4cf185774

diff --git a/android/experimental/LOAndroid3/res/drawable/handle_graphic.png 
b/android/experimental/LOAndroid3/res/drawable/handle_graphic.png
new file mode 100644
index 000..7317eee
Binary files /dev/null and 
b/android/experimental/LOAndroid3/res/drawable/handle_graphic.png differ
diff --git a/include/LibreOfficeKit/LibreOfficeKitGtk.h 
b/include/LibreOfficeKit/LibreOfficeKitGtk.h
index 595f888..ae0aa0e 100644
--- a/include/LibreOfficeKit/LibreOfficeKitGtk.h
+++ b/include/LibreOfficeKit/LibreOfficeKitGtk.h
@@ -81,6 +81,8 @@ struct _LOKDocView
 /// If we are in the middle of a drag of the text selection end handle.
 gboolean m_bInDragEndHandle;
 ///@}
+
+cairo_surface_t* m_pGraphicHandle;
 };
 
 struct _LOKDocViewClass
diff --git a/libreofficekit/source/gtk/lokdocview.c 
b/libreofficekit/source/gtk/lokdocview.c
index 2ab8577..a6108bd 100644
--- a/libreofficekit/source/gtk/lokdocview.c
+++ b/libreofficekit/source/gtk/lokdocview.c
@@ -266,6 +266,8 @@ static void lok_docview_init( LOKDocView* pDocView )
 memset(pDocView-m_aHandleEndRect, 0, sizeof(pDocView-m_aHandleEndRect));
 pDocView-m_bInDragEndHandle = FALSE;
 
+pDocView-m_pGraphicHandle = NULL;
+
 gtk_signal_connect( GTK_OBJECT(pDocView), destroy,
 GTK_SIGNAL_FUNC(lcl_onDestroy), NULL );
 g_signal_connect_after(pDocView-pEventBox, expose-event,
@@ -348,6 +350,67 @@ static void lcl_renderHandle(cairo_t* pCairo, 
GdkRectangle* pCursor, cairo_surfa
 }
 }
 
+/// Renders pHandle around a pSelection rectangle on pCairo.
+static void lcl_renderGraphicHandle(cairo_t* pCairo, GdkRectangle* pSelection, 
cairo_surface_t* pHandle, float fZoom)
+{
+int nHandleWidth, nHandleHeight;
+GdkRectangle aSelection;
+int i;
+
+nHandleWidth = cairo_image_surface_get_width(pHandle);
+nHandleHeight = cairo_image_surface_get_height(pHandle);
+
+aSelection.x = twipToPixel(pSelection-x) * fZoom;
+aSelection.y = twipToPixel(pSelection-y) * fZoom;
+aSelection.width = twipToPixel(pSelection-width) * fZoom;
+aSelection.height = twipToPixel(pSelection-height) * fZoom;
+
+for (i = 0; i  8; ++i)
+{
+int x = aSelection.x, y = aSelection.y;
+cairo_save(pCairo);
+
+switch (i)
+{
+case 0: // top-left
+break;
+case 1: // top-middle
+x += aSelection.width / 2;
+break;
+case 2: // top-right
+x += aSelection.width;
+break;
+case 3: // middle-left
+y += aSelection.height / 2;
+break;
+case 4: // middle-right
+x += aSelection.width;
+y += aSelection.height / 2;
+break;
+case 5: // bottom-left
+y += aSelection.height;
+break;
+case 6: // bottom-middle
+x += aSelection.width / 2;
+y += aSelection.height;
+break;
+case 7: // bottom-right
+x += aSelection.width;
+y += aSelection.height;
+break;
+}
+
+// Center the handle.
+x -= nHandleWidth / 2;
+y -= nHandleHeight / 2;
+
+cairo_translate(pCairo, x, y);
+cairo_set_source_surface(pCairo, pHandle, 0, 0);
+cairo_paint(pCairo);
+cairo_restore(pCairo);
+}
+}
+
 static gboolean renderOverlay(GtkWidget* pWidget, GdkEventExpose* pEvent, 
gpointer pData)
 {
 #if GTK_CHECK_VERSION(2,14,0) // we need gtk_widget_get_window()
@@ -423,6 +486,9 @@ static gboolean renderOverlay(GtkWidget* pWidget, 
GdkEventExpose* pEvent, gpoint
 
 if (!lcl_isEmptyRectangle(pDocView-m_aGraphicSelection))
 {
+if (!pDocView-m_pGraphicHandle)
+pDocView-m_pGraphicHandle = 
cairo_image_surface_create_from_png(CURSOR_HANDLE_DIR handle_graphic.png);
+lcl_renderGraphicHandle(pCairo, pDocView-m_aGraphicSelection, 
pDocView-m_pGraphicHandle, pDocView-fZoom);
 }
 
 cairo_destroy(pCairo);
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'feature/tiled-editing' - android/experimental

2015-03-03 Thread Miklos Vajna
 android/experimental/LOAndroid3/src/java/org/libreoffice/LOKitThread.java |
3 +++
 1 file changed, 3 insertions(+)

New commits:
commit df7aab59c7d6383f420e01293adc54d53bb4e548
Author: Miklos Vajna vmik...@collabora.co.uk
Date:   Tue Mar 3 10:22:45 2015 +0100

android: fix long press not selecting an empty cell

A double click is a set of 4 events, only one of them was sent, that's
how it worked in gtktiledviewer, but not on Android.

Change-Id: Id0eaef3765d385aab588b834f66b9f4b4f3ccb70

diff --git 
a/android/experimental/LOAndroid3/src/java/org/libreoffice/LOKitThread.java 
b/android/experimental/LOAndroid3/src/java/org/libreoffice/LOKitThread.java
index 099d0f2..78e18d3 100644
--- a/android/experimental/LOAndroid3/src/java/org/libreoffice/LOKitThread.java
+++ b/android/experimental/LOAndroid3/src/java/org/libreoffice/LOKitThread.java
@@ -263,7 +263,10 @@ public class LOKitThread extends Thread {
 }
 if (touchType.equals(LongPress)) {
 
mInvalidationHandler.setOverlayState(InvalidationHandler.OverlayState.SELECTION);
+mTileProvider.mouseButtonDown(documentCoordinate, 1);
+mTileProvider.mouseButtonUp(documentCoordinate, 1);
 mTileProvider.mouseButtonDown(documentCoordinate, 2);
+mTileProvider.mouseButtonUp(documentCoordinate, 2);
 } else { // SingleTap
 LibreOfficeMainActivity.mAppContext.showSoftKeyboard();
 
mInvalidationHandler.setOverlayState(InvalidationHandler.OverlayState.CURSOR);
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'feature/tiled-editing' - android/experimental

2015-03-03 Thread Tomaž Vajngerl
 
android/experimental/LOAndroid3/src/java/org/mozilla/gecko/TextSelectionHandle.java
 |   18 ++
 1 file changed, 12 insertions(+), 6 deletions(-)

New commits:
commit fdbebe96c619cb73fe9b5164dfdf29e6dcf3b99f
Author: Tomaž Vajngerl tomaz.vajng...@collabora.co.uk
Date:   Tue Mar 3 17:48:47 2015 +0900

android: fix mHandleType initialization

Change-Id: I40df42b941ab1fbf9d847772e8b5c0ddea5cfcb7

diff --git 
a/android/experimental/LOAndroid3/src/java/org/mozilla/gecko/TextSelectionHandle.java
 
b/android/experimental/LOAndroid3/src/java/org/mozilla/gecko/TextSelectionHandle.java
index 61f5355..36472a5 100644
--- 
a/android/experimental/LOAndroid3/src/java/org/mozilla/gecko/TextSelectionHandle.java
+++ 
b/android/experimental/LOAndroid3/src/java/org/mozilla/gecko/TextSelectionHandle.java
@@ -55,12 +55,18 @@ public class TextSelectionHandle extends ImageView 
implements View.OnTouchListen
 TypedArray a = context.obtainStyledAttributes(attrs, 
R.styleable.TextSelectionHandle);
 int handleType = a.getInt(R.styleable.TextSelectionHandle_handleType, 
0x01);
 
-if (handleType == 0x01) {
-mHandleType = HandleType.START;
-} else if (handleType == 0x02) {
-mHandleType = HandleType.MIDDLE;
-} else if (handleType == 0x03) {
-mHandleType = HandleType.END;
+switch (handleType) {
+case 1:
+mHandleType = HandleType.START;
+break;
+case 2:
+mHandleType = HandleType.MIDDLE;
+break;
+case 3:
+mHandleType = HandleType.END;
+break;
+default:
+throw new RuntimeException(Unknown text handle id);
 }
 
 mIsRTL = false;
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'feature/tiled-editing' - android/experimental

2015-03-01 Thread Tomaž Vajngerl
 
android/experimental/LOAndroid3/src/java/org/libreoffice/InvalidationHandler.java
   |   16 ---
 android/experimental/LOAndroid3/src/java/org/mozilla/gecko/TextSelection.java  
 |2 
 
android/experimental/LOAndroid3/src/java/org/mozilla/gecko/TextSelectionHandle.java
 |   45 +++---
 3 files changed, 39 insertions(+), 24 deletions(-)

New commits:
commit f087bd4c2e5cf393439cece75466aa8afac3c36d
Author: Tomaž Vajngerl tomaz.vajng...@collabora.co.uk
Date:   Mon Mar 2 15:17:35 2015 +0900

android: account for handle repositioning, limit update to 50ms

Text handles are usually shown under the current selection or
cursor position. Previously this was done in InvalidationHandler,
now the TextSelectionHandle takes this into account just before
drawing. The reason is that the repositioning needs to be taken
into account when the handle moves to reposition the coordinates
back to original position.
In addition to that, the number of times the move handle update
event is send is now limited to 50ms to reduce stress for the
device (less in queue, less messages via LOKit). This also makes
the handle more fluid and jump around less.

Change-Id: Idc401375c82b3eeac66328d98c80bf3cb7b675ea

diff --git 
a/android/experimental/LOAndroid3/src/java/org/libreoffice/InvalidationHandler.java
 
b/android/experimental/LOAndroid3/src/java/org/libreoffice/InvalidationHandler.java
index 1f3b39b..8efc6f4 100644
--- 
a/android/experimental/LOAndroid3/src/java/org/libreoffice/InvalidationHandler.java
+++ 
b/android/experimental/LOAndroid3/src/java/org/libreoffice/InvalidationHandler.java
@@ -119,16 +119,6 @@ public class InvalidationHandler {
 }
 
 /**
- * From input rectangle, create a new rectangle which positions under the 
input rectangle.
- *
- * @param rectangle - input rectangle
- * @return new rectangle positioned under the input rectangle
- */
-private RectF createRectangleUnderSelection(RectF rectangle) {
-return new RectF(rectangle.centerX(), rectangle.bottom, 
rectangle.centerX(), rectangle.bottom);
-}
-
-/**
  * Handles the tile invalidation message
  *
  * @param payload
@@ -149,7 +139,7 @@ public class InvalidationHandler {
 RectF cursorRectangle = convertPayloadToRectangle(payload);
 if (cursorRectangle != null) {
 if (mState == OverlayState.CURSOR) {
-
mTextSelection.positionHandle(TextSelectionHandle.HandleType.MIDDLE, 
createRectangleUnderSelection(cursorRectangle));
+
mTextSelection.positionHandle(TextSelectionHandle.HandleType.MIDDLE, 
cursorRectangle);
 
mTextSelection.showHandle(TextSelectionHandle.HandleType.MIDDLE);
 
mTextSelection.hideHandle(TextSelectionHandle.HandleType.START);
 mTextSelection.hideHandle(TextSelectionHandle.HandleType.END);
@@ -170,7 +160,7 @@ public class InvalidationHandler {
 }
 RectF selectionRectangle = convertPayloadToRectangle(payload);
 if (selectionRectangle != null) {
-
mTextSelection.positionHandle(TextSelectionHandle.HandleType.START, 
createRectangleUnderSelection(selectionRectangle));
+
mTextSelection.positionHandle(TextSelectionHandle.HandleType.START, 
selectionRectangle);
 mTextSelection.showHandle(TextSelectionHandle.HandleType.START);
 mTextSelection.hideHandle(TextSelectionHandle.HandleType.MIDDLE);
 mState = OverlayState.SELECTION;
@@ -188,7 +178,7 @@ public class InvalidationHandler {
 }
 RectF selectionRect = convertPayloadToRectangle(payload);
 if (selectionRect != null) {
-mTextSelection.positionHandle(TextSelectionHandle.HandleType.END, 
createRectangleUnderSelection(selectionRect));
+mTextSelection.positionHandle(TextSelectionHandle.HandleType.END, 
selectionRect);
 mTextSelection.showHandle(TextSelectionHandle.HandleType.END);
 mTextSelection.hideHandle(TextSelectionHandle.HandleType.MIDDLE);
 mState = OverlayState.SELECTION;
diff --git 
a/android/experimental/LOAndroid3/src/java/org/mozilla/gecko/TextSelection.java 
b/android/experimental/LOAndroid3/src/java/org/mozilla/gecko/TextSelection.java
index 2f05e4f..94f9b90 100644
--- 
a/android/experimental/LOAndroid3/src/java/org/mozilla/gecko/TextSelection.java
+++ 
b/android/experimental/LOAndroid3/src/java/org/mozilla/gecko/TextSelection.java
@@ -108,7 +108,7 @@ public class TextSelection extends Layer {
 LOKitShell.getMainHandler().post(new Runnable() {
 public void run() {
 TextSelectionHandle handle = getHandle(handleType);
-handle.positionFromGecko((int) position.left, (int) 
position.top, false);
+handle.positionFromGecko(position, false);
 }
 });
 }
diff --git 

[Libreoffice-commits] core.git: Branch 'feature/tiled-editing' - android/experimental

2015-02-28 Thread Siqi Liu
 
android/experimental/LOAndroid3/src/java/org/libreoffice/OnSlideSwipeListener.java
 |2 --
 1 file changed, 2 deletions(-)

New commits:
commit f58a6fe9971acc6b7639e47444eb3674faa6934d
Author: Siqi Liu m...@siqi.fr
Date:   Sat Feb 28 22:07:36 2015 +0100

remove unused boolean (propagating touchEvent instead of intercepting it)

Change-Id: If05cf04414572fea809104c7fed309afb2438bfd

diff --git 
a/android/experimental/LOAndroid3/src/java/org/libreoffice/OnSlideSwipeListener.java
 
b/android/experimental/LOAndroid3/src/java/org/libreoffice/OnSlideSwipeListener.java
index 1dc33f6..b1ee37e 100644
--- 
a/android/experimental/LOAndroid3/src/java/org/libreoffice/OnSlideSwipeListener.java
+++ 
b/android/experimental/LOAndroid3/src/java/org/libreoffice/OnSlideSwipeListener.java
@@ -27,7 +27,6 @@ public class OnSlideSwipeListener implements OnTouchListener {
 
 @Override
 public boolean onFling(MotionEvent e1, MotionEvent e2, float velX, 
float velY) {
-boolean result = false;
 try {
 float diffY = e2.getY() - e1.getY();
 float diffX = e2.getX() - e1.getX();
@@ -40,7 +39,6 @@ public class OnSlideSwipeListener implements OnTouchListener {
 onSwipeLeft();
 }
 }
-result = true;
 }
 } catch (Exception exception) {
 exception.printStackTrace();
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'feature/tiled-editing' - android/experimental

2015-02-25 Thread Tomaž Vajngerl
 android/experimental/LOAndroid3/src/java/org/libreoffice/LOKitThread.java |
4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

New commits:
commit 5a2eeef636cdc16dd0c8978c491c93a5ab429720
Author: Tomaž Vajngerl tomaz.vajng...@collabora.co.uk
Date:   Thu Feb 26 16:42:56 2015 +0900

android: first set overlay state and send mouse button event later

Change-Id: I30d909ce04baaab8bed1e8bd03b4926b95ed95ee

diff --git 
a/android/experimental/LOAndroid3/src/java/org/libreoffice/LOKitThread.java 
b/android/experimental/LOAndroid3/src/java/org/libreoffice/LOKitThread.java
index c2dbb23..6f63e93 100644
--- a/android/experimental/LOAndroid3/src/java/org/libreoffice/LOKitThread.java
+++ b/android/experimental/LOAndroid3/src/java/org/libreoffice/LOKitThread.java
@@ -232,13 +232,13 @@ public class LOKitThread extends Thread {
 }
 if (touchType.equals(LongPress)) {
 LibreOfficeMainActivity.mAppContext.hideSoftKeyboard();
-mTileProvider.mouseButtonDown(mDocumentTouchCoordinate, 2);
 
mInvalidationHandler.setOverlayState(InvalidationHandler.OverlayState.SELECTION);
+mTileProvider.mouseButtonDown(mDocumentTouchCoordinate, 2);
 } else { // SingleTap
 LibreOfficeMainActivity.mAppContext.showSoftKeyboard();
+
mInvalidationHandler.setOverlayState(InvalidationHandler.OverlayState.CURSOR);
 mTileProvider.mouseButtonDown(mDocumentTouchCoordinate, 1);
 mTileProvider.mouseButtonUp(mDocumentTouchCoordinate, 1);
-
mInvalidationHandler.setOverlayState(InvalidationHandler.OverlayState.CURSOR);
 }
 }
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'feature/tiled-editing' - android/experimental

2015-02-25 Thread Miklos Vajna
 android/experimental/LOAndroid3/src/java/org/libreoffice/LOKitThread.java |
1 +
 1 file changed, 1 insertion(+)

New commits:
commit 60287f6bdbebdf6f29143653038887116921e91f
Author: Miklos Vajna vmik...@collabora.co.uk
Date:   Wed Feb 25 12:31:22 2015 +0100

android: let LOKitThread::touch() invoke mouseButtonUp(), too

This fixes the click into one shape, type something, click into an
other shape scenario that was already working in gtktiledviewer.

Change-Id: I79c7174274115b2ab61ea4d0f1de4306f5172a64

diff --git 
a/android/experimental/LOAndroid3/src/java/org/libreoffice/LOKitThread.java 
b/android/experimental/LOAndroid3/src/java/org/libreoffice/LOKitThread.java
index eae8ba5..0507efc 100644
--- a/android/experimental/LOAndroid3/src/java/org/libreoffice/LOKitThread.java
+++ b/android/experimental/LOAndroid3/src/java/org/libreoffice/LOKitThread.java
@@ -233,6 +233,7 @@ public class LOKitThread extends Thread {
 } else { // SingleTap
 LibreOfficeMainActivity.mAppContext.showSoftKeyboard();
 mTileProvider.mouseButtonDown(mDocumentTouchCoordinate, 1);
+mTileProvider.mouseButtonUp(mDocumentTouchCoordinate, 1);
 }
 }
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'feature/tiled-editing' - android/experimental

2015-02-23 Thread Miklos Vajna
 android/experimental/LOAndroid3/src/java/org/libreoffice/LOKitShell.java |
2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 7e250134b5d7e8fe7aa9fa42e2e5723f07fe1193
Author: Miklos Vajna vmik...@collabora.co.uk
Date:   Mon Feb 23 15:05:09 2015 +0100

android: enable editing by default

Change-Id: I1428c0bf5c4df8d5d0ede026d0f2e31ac48ce226

diff --git 
a/android/experimental/LOAndroid3/src/java/org/libreoffice/LOKitShell.java 
b/android/experimental/LOAndroid3/src/java/org/libreoffice/LOKitShell.java
index e3e7a36..b2b4b9d 100644
--- a/android/experimental/LOAndroid3/src/java/org/libreoffice/LOKitShell.java
+++ b/android/experimental/LOAndroid3/src/java/org/libreoffice/LOKitShell.java
@@ -61,7 +61,7 @@ public class LOKitShell {
 }
 
 public static boolean isEditingEnabled() {
-return false;
+return true;
 }
 
 public static LayerView getLayerView() {
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'feature/tiled-editing' - android/experimental

2015-02-23 Thread Tomaž Vajngerl
 
android/experimental/LOAndroid3/src/java/org/libreoffice/InvalidationHandler.java
 |   41 +-
 1 file changed, 38 insertions(+), 3 deletions(-)

New commits:
commit af0ecaa6dca6c643d1121c22d0c899492f6d3134
Author: Tomaž Vajngerl tomaz.vajng...@collabora.co.uk
Date:   Mon Feb 23 22:09:25 2015 +0900

android: add comments to InvalidationHandler

Change-Id: Ie40b711377d46a37ae7cdae1496919049b5b7736

diff --git 
a/android/experimental/LOAndroid3/src/java/org/libreoffice/InvalidationHandler.java
 
b/android/experimental/LOAndroid3/src/java/org/libreoffice/InvalidationHandler.java
index a37d3d4..ae18647b 100644
--- 
a/android/experimental/LOAndroid3/src/java/org/libreoffice/InvalidationHandler.java
+++ 
b/android/experimental/LOAndroid3/src/java/org/libreoffice/InvalidationHandler.java
@@ -7,12 +7,21 @@ import org.libreoffice.kit.Document;
 import org.mozilla.gecko.TextSelection;
 import org.mozilla.gecko.TextSelectionHandle;
 
+/**
+ * Parses (interprets) and handles invalidation messages from LibreOffice.
+ */
 public class InvalidationHandler {
 private static String LOGTAG = InvalidationHandler.class.getSimpleName();
 
 public InvalidationHandler() {
 }
 
+/**
+ * Processes invalidation message
+ *
+ * @param messageID - ID of the message
+ * @param payload - additional invalidation message payload
+ */
 public void processMessage(int messageID, String payload) {
 switch (messageID) {
 case Document.CALLBACK_INVALIDATE_TILES:
@@ -36,12 +45,18 @@ public class InvalidationHandler {
 }
 }
 
-private RectF convertCallbackMessageStringToRectF(String text) {
-if (text.equals(EMPTY)) {
+/**
+ * Parses the invalidation message text and converts to rectangle in pixel 
coordinates
+ *
+ * @param messageText - invalidation message text
+ * @return rectangle in pixel coordinates
+ */
+private RectF convertCallbackMessageStringToRectF(String messageText) {
+if (messageText.equals(EMPTY)) {
 return null;
 }
 
-String[] coordinates = text.split(,);
+String[] coordinates = messageText.split(,);
 
 if (coordinates.length != 4) {
 return null;
@@ -63,6 +78,10 @@ public class InvalidationHandler {
 return rect;
 }
 
+/**
+ * Handles the cursor invalidation message
+ * @param payload
+ */
 private void invalidateCursor(String payload) {
 RectF rect = convertCallbackMessageStringToRectF(payload);
 if (rect != null) {
@@ -77,6 +96,10 @@ public class InvalidationHandler {
 }
 }
 
+/**
+ * Handles the tile invalidation message
+ * @param payload
+ */
 private void invalidateTiles(String payload) {
 RectF rect = convertCallbackMessageStringToRectF(payload);
 if (rect != null) {
@@ -84,6 +107,10 @@ public class InvalidationHandler {
 }
 }
 
+/**
+ * Handles the selection start invalidation message
+ * @param payload
+ */
 private void invalidateSelectionStart(String payload) {
 RectF rect = convertCallbackMessageStringToRectF(payload);
 if (rect != null) {
@@ -99,6 +126,10 @@ public class InvalidationHandler {
 }
 }
 
+/**
+ * Handles the selection end invalidation message
+ * @param payload
+ */
 private void invalidateSelectionEnd(String payload) {
 RectF rect = convertCallbackMessageStringToRectF(payload);
 if (rect != null) {
@@ -114,6 +145,10 @@ public class InvalidationHandler {
 }
 }
 
+/**
+ * Handles the selection invalidation message
+ * @param payload
+ */
 private void invalidateSelection(String payload) {
 if (payload.isEmpty()) {
 TextSelection textSelection = 
LibreOfficeMainActivity.mAppContext.getTextSelection();
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'feature/tiled-editing' - android/experimental

2015-02-23 Thread Tomaž Vajngerl
 android/experimental/LOAndroid3/src/java/org/libreoffice/LOEvent.java |   
31 ++
 android/experimental/LOAndroid3/src/java/org/libreoffice/LOKitShell.java  |   
10 +--
 android/experimental/LOAndroid3/src/java/org/libreoffice/LOKitThread.java |
9 +-
 3 files changed, 21 insertions(+), 29 deletions(-)

New commits:
commit 858053926f20d22875956926e2371dd8d5bebc36
Author: Tomaž Vajngerl tomaz.vajng...@collabora.co.uk
Date:   Fri Feb 20 16:58:39 2015 +0900

android: LOEvents - remove unndeded, comments

Change-Id: I67976c2b72bf0f7ca044e479fa71b8adbaafdefc

diff --git 
a/android/experimental/LOAndroid3/src/java/org/libreoffice/LOEvent.java 
b/android/experimental/LOAndroid3/src/java/org/libreoffice/LOEvent.java
index 807d0d0..bce6284 100644
--- a/android/experimental/LOAndroid3/src/java/org/libreoffice/LOEvent.java
+++ b/android/experimental/LOAndroid3/src/java/org/libreoffice/LOEvent.java
@@ -11,29 +11,26 @@ import org.mozilla.gecko.gfx.SubTile;
 
 public class LOEvent implements ComparableLOEvent {
 public static final int SIZE_CHANGED = 1;
-public static final int TILE_SIZE = 2;
-public static final int CHANGE_PART = 3;
-public static final int LOAD = 4;
-public static final int CLOSE = 5;
-public static final int REDRAW = 6;
-public static final int TILE_REEVALUATION_REQUEST = 7;
-public static final int THUMBNAIL = 8;
-public static final int TILE_INVALIDATION = 9;
-public static final int TOUCH = 10;
-public static final int KEY_EVENT = 11;
+public static final int CHANGE_PART = 2;
+public static final int LOAD = 3;
+public static final int CLOSE = 4;
+public static final int TILE_REEVALUATION_REQUEST = 5;
+public static final int THUMBNAIL = 6;
+public static final int TILE_INVALIDATION = 7;
+public static final int TOUCH = 8;
+public static final int KEY_EVENT = 9;
 
 public final int mType;
 public int mPriority = 0;
+public String mTypeString;
 
 public ThumbnailCreator.ThumbnailCreationTask mTask;
-public String mTypeString;
 public int mPartIndex;
 public String mFilename;
 public ComposedTileLayer mComposedTileLayer;
 public String mTouchType;
 public MotionEvent mMotionEvent;
 public PointF mDocumentTouchCoordinate;
-public String mKeyEventType;
 public KeyEvent mKeyEvent;
 public RectF mInvalidationRect;
 
@@ -41,11 +38,6 @@ public class LOEvent implements ComparableLOEvent {
 mType = type;
 }
 
-public LOEvent(int type, int widthPixels, int heightPixels) {
-mType = type;
-mTypeString = Size Changed:  + widthPixels +   + heightPixels;
-}
-
 public LOEvent(int type, ComposedTileLayer composedTileLayer) {
 mType = type;
 mTypeString = Tile Reevaluation;
@@ -58,11 +50,6 @@ public class LOEvent implements ComparableLOEvent {
 mFilename = filename;
 }
 
-public LOEvent(int type, IntSize tileSize) {
-mType = type;
-mTypeString = Tile size;
-}
-
 public LOEvent(int type, int partIndex) {
 mType = type;
 mPartIndex = partIndex;
diff --git 
a/android/experimental/LOAndroid3/src/java/org/libreoffice/LOKitShell.java 
b/android/experimental/LOAndroid3/src/java/org/libreoffice/LOKitShell.java
index 2037e9d..94c47c0 100644
--- a/android/experimental/LOAndroid3/src/java/org/libreoffice/LOKitShell.java
+++ b/android/experimental/LOAndroid3/src/java/org/libreoffice/LOKitShell.java
@@ -113,14 +113,16 @@ public class LOKitShell {
 LOKitShell.sendEvent(new LOEvent(LOEvent.CLOSE));
 }
 
-public static void sendRedrawEvent() {
-LOKitShell.sendEvent(new LOEvent(LOEvent.REDRAW));
-}
-
+/**
+ * Send tile reevaluation to LOKitThread.
+ */
 public static void sendTileReevaluationRequest(ComposedTileLayer 
composedTileLayer) {
 LOKitShell.sendEvent(new LOEvent(LOEvent.TILE_REEVALUATION_REQUEST, 
composedTileLayer));
 }
 
+/**
+ * Send tile invalidation to LOKitThread.
+ */
 public static void sendTileInvalidationRequest(RectF rect) {
 LOKitShell.sendEvent(new LOEvent(LOEvent.TILE_INVALIDATION, rect));
 }
diff --git 
a/android/experimental/LOAndroid3/src/java/org/libreoffice/LOKitThread.java 
b/android/experimental/LOAndroid3/src/java/org/libreoffice/LOKitThread.java
index 9ec76be..eae8ba5 100644
--- a/android/experimental/LOAndroid3/src/java/org/libreoffice/LOKitThread.java
+++ b/android/experimental/LOAndroid3/src/java/org/libreoffice/LOKitThread.java
@@ -93,7 +93,9 @@ public class LOKitThread extends Thread {
 mLayerClient.forceRender();
 }
 
-/** Handle the geometry change + draw. */
+/**
+ * Handle the geometry change + draw.
+ */
 private void redraw() {
 if (mLayerClient == null || mTileProvider == null) {
 // called too early...
@@ -128,7 +130,9 @@ public class LOKitThread extends Thread {
 }
 }
 
-

[Libreoffice-commits] core.git: Branch 'feature/tiled-editing' - android/experimental

2015-02-16 Thread Tomaž Vajngerl
 android/experimental/LOAndroid3/src/java/org/libreoffice/LOKitThread.java  
|1 
 android/experimental/LOAndroid3/src/java/org/mozilla/gecko/TextSelection.java  
|6 +---
 
android/experimental/LOAndroid3/src/java/org/mozilla/gecko/TextSelectionHandle.java
|   13 --
 
android/experimental/LOAndroid3/src/java/org/mozilla/gecko/ZoomConstraints.java 
   |3 --
 
android/experimental/LOAndroid3/src/java/org/mozilla/gecko/gfx/DisplayPortMetrics.java
 |1 
 android/experimental/LOAndroid3/src/java/org/mozilla/gecko/gfx/FloatSize.java  
|3 --
 
android/experimental/LOAndroid3/src/java/org/mozilla/gecko/gfx/GeckoLayerClient.java
   |5 ---
 
android/experimental/LOAndroid3/src/java/org/mozilla/gecko/gfx/InputConnectionHandler.java
 |2 -
 
android/experimental/LOAndroid3/src/java/org/mozilla/gecko/gfx/LayerRenderer.java
  |5 ---
 
android/experimental/LOAndroid3/src/java/org/mozilla/gecko/gfx/SimpleScaleGestureDetector.java
 |1 
 
android/experimental/LOAndroid3/src/java/org/mozilla/gecko/gfx/TouchEventHandler.java
  |3 --
 
android/experimental/LOAndroid3/src/java/org/mozilla/gecko/util/FloatUtils.java 
   |2 -
 12 files changed, 11 insertions(+), 34 deletions(-)

New commits:
commit fab9a76f044e7f2bbaebd7d83ff008baf2129a42
Author: Tomaž Vajngerl tomaz.vajng...@collabora.co.uk
Date:   Tue Feb 17 12:39:09 2015 +0900

android: organise imports

Change-Id: I4ba05594215564ee06c0bf9b8dff47f46e6bf451

diff --git 
a/android/experimental/LOAndroid3/src/java/org/libreoffice/LOKitThread.java 
b/android/experimental/LOAndroid3/src/java/org/libreoffice/LOKitThread.java
index 0ea2829..b76a684 100644
--- a/android/experimental/LOAndroid3/src/java/org/libreoffice/LOKitThread.java
+++ b/android/experimental/LOAndroid3/src/java/org/libreoffice/LOKitThread.java
@@ -7,7 +7,6 @@ import android.util.Log;
 import android.view.KeyEvent;
 import android.view.MotionEvent;
 
-import org.mozilla.gecko.gfx.BufferedCairoImage;
 import org.mozilla.gecko.gfx.CairoImage;
 import org.mozilla.gecko.gfx.ComposedTileLayer;
 import org.mozilla.gecko.gfx.GeckoLayerClient;
diff --git 
a/android/experimental/LOAndroid3/src/java/org/mozilla/gecko/TextSelection.java 
b/android/experimental/LOAndroid3/src/java/org/mozilla/gecko/TextSelection.java
index 2ae1539..2f05e4f 100644
--- 
a/android/experimental/LOAndroid3/src/java/org/mozilla/gecko/TextSelection.java
+++ 
b/android/experimental/LOAndroid3/src/java/org/mozilla/gecko/TextSelection.java
@@ -9,16 +9,14 @@ import android.graphics.RectF;
 import android.util.Log;
 import android.view.View;
 
-import org.json.JSONArray;
-import org.json.JSONObject;
 import org.libreoffice.LOKitShell;
-import org.libreoffice.LibreOfficeMainActivity;
 import org.libreoffice.R;
 import org.mozilla.gecko.gfx.Layer;
 import org.mozilla.gecko.gfx.LayerView;
 import org.mozilla.gecko.util.FloatUtils;
 
-import static org.mozilla.gecko.TextSelectionHandle.HandleType.*;
+import static org.mozilla.gecko.TextSelectionHandle.HandleType.MIDDLE;
+import static org.mozilla.gecko.TextSelectionHandle.HandleType.START;
 
 public class TextSelection extends Layer {
 private static final String LOGTAG = GeckoTextSelection;
diff --git 
a/android/experimental/LOAndroid3/src/java/org/mozilla/gecko/TextSelectionHandle.java
 
b/android/experimental/LOAndroid3/src/java/org/mozilla/gecko/TextSelectionHandle.java
index 6f85db9..6b07a3f 100644
--- 
a/android/experimental/LOAndroid3/src/java/org/mozilla/gecko/TextSelectionHandle.java
+++ 
b/android/experimental/LOAndroid3/src/java/org/mozilla/gecko/TextSelectionHandle.java
@@ -4,13 +4,6 @@
 
 package org.mozilla.gecko;
 
-import org.libreoffice.LOKitShell;
-import org.libreoffice.R;
-import org.mozilla.gecko.gfx.ImmutableViewportMetrics;
-import org.mozilla.gecko.gfx.LayerView;
-
-import org.json.JSONObject;
-
 import android.content.Context;
 import android.content.res.TypedArray;
 import android.graphics.PointF;
@@ -21,6 +14,12 @@ import android.view.View;
 import android.widget.ImageView;
 import android.widget.RelativeLayout;
 
+import org.json.JSONObject;
+import org.libreoffice.LOKitShell;
+import org.libreoffice.R;
+import org.mozilla.gecko.gfx.ImmutableViewportMetrics;
+import org.mozilla.gecko.gfx.LayerView;
+
 public class TextSelectionHandle extends ImageView implements 
View.OnTouchListener {
 private static final String LOGTAG = 
TextSelectionHandle.class.getSimpleName();
 
diff --git 
a/android/experimental/LOAndroid3/src/java/org/mozilla/gecko/ZoomConstraints.java
 
b/android/experimental/LOAndroid3/src/java/org/mozilla/gecko/ZoomConstraints.java
index 4ac49f7..eba0dfe 100644
--- 
a/android/experimental/LOAndroid3/src/java/org/mozilla/gecko/ZoomConstraints.java
+++ 
b/android/experimental/LOAndroid3/src/java/org/mozilla/gecko/ZoomConstraints.java
@@ -5,9 +5,6 @@
 
 package org.mozilla.gecko;

[Libreoffice-commits] core.git: Branch 'feature/tiled-editing' - android/experimental

2015-02-04 Thread Tomaž Vajngerl
 android/experimental/LOAndroid3/src/java/org/libreoffice/TextCursorView.java | 
  12 +-
 1 file changed, 11 insertions(+), 1 deletion(-)

New commits:
commit a1368867ae60f6d79469ad439ec5e200740ab4ef
Author: Tomaž Vajngerl tomaz.vajng...@collabora.co.uk
Date:   Wed Feb 4 21:13:45 2015 +0900

android: blinking cursor

Change-Id: I1e2d5df7917ec0f8e780e3e3481dadd10b1b76ed

diff --git 
a/android/experimental/LOAndroid3/src/java/org/libreoffice/TextCursorView.java 
b/android/experimental/LOAndroid3/src/java/org/libreoffice/TextCursorView.java
index d9e51fc..1aed2f0 100644
--- 
a/android/experimental/LOAndroid3/src/java/org/libreoffice/TextCursorView.java
+++ 
b/android/experimental/LOAndroid3/src/java/org/libreoffice/TextCursorView.java
@@ -29,9 +29,11 @@ public class TextCursorView extends ImageView {
 
 private int mWidth;
 private int mHeight;
+private int mAlpha = 0;
 
 public TextCursorView(Context context, AttributeSet attrs) {
 super(context, attrs);
+postDelayed(cursorAnimation, 500);
 }
 
 public void changePosition(RectF position) {
@@ -57,7 +59,6 @@ public class TextCursorView extends ImageView {
 mTop = Math.round(scaled.centerY() - y);
 
 setScaleY(scaled.height());
-
 setLayoutPosition();
 }
 
@@ -76,4 +77,13 @@ public class TextCursorView extends ImageView {
 
 setLayoutParams(mLayoutParams);
 }
+
+private Runnable cursorAnimation = new Runnable() {
+public void run() {
+mAlpha = mAlpha == 0 ? 0xFF : 0;
+getDrawable().setAlpha(mAlpha);
+invalidate();
+postDelayed(cursorAnimation, 500);
+}
+};
 }
\ No newline at end of file
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'feature/tiled-editing' - android/experimental

2015-02-03 Thread Jan Holesovsky
 
android/experimental/LOAndroid3/src/java/org/libreoffice/LOKitTileProvider.java 
|4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

New commits:
commit 74aacc49a8c9f17fe29308031e597691b4a05409
Author: Jan Holesovsky ke...@collabora.com
Date:   Tue Feb 3 11:44:54 2015 +0100

android: Always log the SAL_WARN's.

Change-Id: Iab470097cc09835efd5ab3c13a0defb267c985a0

diff --git 
a/android/experimental/LOAndroid3/src/java/org/libreoffice/LOKitTileProvider.java
 
b/android/experimental/LOAndroid3/src/java/org/libreoffice/LOKitTileProvider.java
index f416b45..48868f9 100644
--- 
a/android/experimental/LOAndroid3/src/java/org/libreoffice/LOKitTileProvider.java
+++ 
b/android/experimental/LOAndroid3/src/java/org/libreoffice/LOKitTileProvider.java
@@ -46,7 +46,7 @@ public class LOKitTileProvider implements TileProvider, 
Document.MessageCallback
 mTileWidth = pixelToTwip(TILE_SIZE, mDPI);
 mTileHeight = pixelToTwip(TILE_SIZE, mDPI);
 
-LibreOfficeKit.putenv(SAL_LOG=-WARN+INFO.lok);
+LibreOfficeKit.putenv(SAL_LOG=+WARN+INFO.lok);
 LibreOfficeKit.init(LibreOfficeMainActivity.mAppContext);
 
 mOffice = new Office(LibreOfficeKit.getLibreOfficeKitHandle());
@@ -66,7 +66,7 @@ public class LOKitTileProvider implements TileProvider, 
Document.MessageCallback
 mOffice = new Office(handle);
 Log.i(LOGTAG,  new Office created);
 mDocument = mOffice.documentLoad(input);
-LibreOfficeKit.putenv(SAL_LOG=-WARN+INFO.lok);
+LibreOfficeKit.putenv(SAL_LOG=+WARN+INFO.lok);
 }
 
 Log.i(LOGTAG,  mDocument =  + mDocument);
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'feature/tiled-editing' - android/experimental

2015-01-29 Thread Tomaž Vajngerl
 android/experimental/LOAndroid3/src/java/org/libreoffice/LOKitThread.java  
 |   37 +-
 
android/experimental/LOAndroid3/src/java/org/libreoffice/LOKitTileProvider.java 
|   10 +-
 2 files changed, 27 insertions(+), 20 deletions(-)

New commits:
commit 14fe82c911554d4e4feb1145e8b0b71c6140da2c
Author: Tomaž Vajngerl tomaz.vajng...@collabora.co.uk
Date:   Fri Jan 30 13:42:58 2015 +0900

android: mute invalid. if not editing, don't show handle on touch

Change-Id: I551af3849f9b0a10106bf02fff220fa4600eb07f

diff --git 
a/android/experimental/LOAndroid3/src/java/org/libreoffice/LOKitThread.java 
b/android/experimental/LOAndroid3/src/java/org/libreoffice/LOKitThread.java
index 354404c..7e99da3 100644
--- a/android/experimental/LOAndroid3/src/java/org/libreoffice/LOKitThread.java
+++ b/android/experimental/LOAndroid3/src/java/org/libreoffice/LOKitThread.java
@@ -4,6 +4,7 @@ import android.graphics.Bitmap;
 import android.graphics.PointF;
 import android.graphics.RectF;
 import android.util.Log;
+import android.view.KeyEvent;
 import android.view.MotionEvent;
 
 import org.mozilla.gecko.gfx.CairoImage;
@@ -159,25 +160,35 @@ public class LOKitThread extends Thread implements 
TileProvider.TileInvalidation
 createThumbnail(event.mTask);
 break;
 case LOEvent.TOUCH:
-if (!LOKitShell.isEditingEnabled()) {
-return;
-}
 touch(event.mTouchType, event.mMotionEvent, 
event.mDocumentTouchCoordinate);
 break;
 case LOEvent.KEY_EVENT:
-if (!LOKitShell.isEditingEnabled()) {
-return;
-}
-if (event.mKeyEventType == KeyPress) {
-mTileProvider.keyPress(event.mKeyEvent);
-} else if (event.mKeyEventType.equals(KeyRelease)) {
-mTileProvider.keyRelease(event.mKeyEvent);
-}
+keyEvent(event.mKeyEventType, event.mKeyEvent);
 break;
 }
 }
 
+/**
+ * Processes key events.
+ */
+private void keyEvent(String keyEventType, KeyEvent keyEvent) {
+if (!LOKitShell.isEditingEnabled()) {
+return;
+}
+if (keyEventType == KeyPress) {
+mTileProvider.keyPress(keyEvent);
+} else if (keyEventType.equals(KeyRelease)) {
+mTileProvider.keyRelease(keyEvent);
+}
+}
+
+/**
+ * Processes touch events.
+ */
 private void touch(String touchType, MotionEvent motionEvent, PointF 
mDocumentTouchCoordinate) {
+if (!LOKitShell.isEditingEnabled()) {
+return;
+}
 LibreOfficeMainActivity.mAppContext.showSoftKeyboard();
 mTileProvider.mouseButtonDown(mDocumentTouchCoordinate);
 }
@@ -197,10 +208,6 @@ 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();
diff --git 
a/android/experimental/LOAndroid3/src/java/org/libreoffice/LOKitTileProvider.java
 
b/android/experimental/LOAndroid3/src/java/org/libreoffice/LOKitTileProvider.java
index c5f31b3..0bf9f1f 100644
--- 
a/android/experimental/LOAndroid3/src/java/org/libreoffice/LOKitTileProvider.java
+++ 
b/android/experimental/LOAndroid3/src/java/org/libreoffice/LOKitTileProvider.java
@@ -310,10 +310,6 @@ public class LOKitTileProvider implements TileProvider, 
Document.MessageCallback
 int x = (int) pixelToTwip(inDocument.x, mDPI);
 int y = (int) pixelToTwip(inDocument.y, mDPI);
 
-TextSelection textSelection = 
LibreOfficeMainActivity.mAppContext.getTextSelection();
-textSelection.positionHandle(MIDDLE, new RectF(inDocument.x, 
inDocument.y, inDocument.x, inDocument.y));
-textSelection.showHandle(MIDDLE);
-
 mDocument.postMouseEvent(type, x, y);
 }
 
@@ -378,6 +374,10 @@ public class LOKitTileProvider implements TileProvider, 
Document.MessageCallback
  */
 @Override
 public void messageRetrieved(int signalNumber, String payload) {
+if (!LOKitShell.isEditingEnabled()) {
+return;
+}
+
 switch (signalNumber) {
 case Document.CALLBACK_INVALIDATE_TILES: {
 RectF rect = convertCallbackMessageStringToRectF(payload);
@@ -391,7 +391,7 @@ public class LOKitTileProvider implements TileProvider, 
Document.MessageCallback
 RectF rect = convertCallbackMessageStringToRectF(payload);
 if (rect != null) {
 TextSelection textSelection = 
LibreOfficeMainActivity.mAppContext.getTextSelection();
-textSelection.positionHandle(MIDDLE, rect);
+

[Libreoffice-commits] core.git: Branch 'feature/tiled-editing' - android/experimental

2015-01-22 Thread Miklos Vajna
 
android/experimental/LOAndroid3/src/java/org/libreoffice/LOKitTileProvider.java 
|3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

New commits:
commit 203725a7daccfb015f2242f37a26e4f66a97c1bb
Author: Miklos Vajna vmik...@collabora.co.uk
Date:   Thu Jan 22 17:50:02 2015 +0100

android: use getUnicodeChar() in LOKitTileProvider

Follow gtktiledviewer's approach for keycodes: unless it's a special
key, ask the system to provide the Unicode equivalent and send that.
This makes typing work, except for special keys.

Change-Id: If9891ddfb0d52e1160099aa00580d1b261e71e61

diff --git 
a/android/experimental/LOAndroid3/src/java/org/libreoffice/LOKitTileProvider.java
 
b/android/experimental/LOAndroid3/src/java/org/libreoffice/LOKitTileProvider.java
index a6d8d79..0e0b031 100644
--- 
a/android/experimental/LOAndroid3/src/java/org/libreoffice/LOKitTileProvider.java
+++ 
b/android/experimental/LOAndroid3/src/java/org/libreoffice/LOKitTileProvider.java
@@ -278,7 +278,8 @@ public class LOKitTileProvider implements TileProvider, 
Document.MessageCallback
 
 @Override
 public void keyPress(KeyEvent keyEvent) {
-mOffice.postKeyEvent(Office.KEY_PRESS, keyEvent.getKeyCode());
+int code = keyEvent.getUnicodeChar();
+mOffice.postKeyEvent(Office.KEY_PRESS, code);
 }
 
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'feature/tiled-editing' - android/experimental

2015-01-22 Thread Miklos Vajna
 
android/experimental/LOAndroid3/src/java/org/libreoffice/LOKitTileProvider.java 
|   14 +-
 1 file changed, 13 insertions(+), 1 deletion(-)

New commits:
commit a07858d80694e6991234e150c7d83be699ffbfe5
Author: Miklos Vajna vmik...@collabora.co.uk
Date:   Thu Jan 22 18:27:36 2015 +0100

android: translate DEL/ENTER in LOKitTileProvider

Change-Id: Idda4769fc85a4059ba46706430f30ed247dddaa3

diff --git 
a/android/experimental/LOAndroid3/src/java/org/libreoffice/LOKitTileProvider.java
 
b/android/experimental/LOAndroid3/src/java/org/libreoffice/LOKitTileProvider.java
index 0e0b031..08561d8 100644
--- 
a/android/experimental/LOAndroid3/src/java/org/libreoffice/LOKitTileProvider.java
+++ 
b/android/experimental/LOAndroid3/src/java/org/libreoffice/LOKitTileProvider.java
@@ -278,7 +278,19 @@ public class LOKitTileProvider implements TileProvider, 
Document.MessageCallback
 
 @Override
 public void keyPress(KeyEvent keyEvent) {
-int code = keyEvent.getUnicodeChar();
+int code = 0;
+switch (keyEvent.getKeyCode())
+{
+case KeyEvent.KEYCODE_DEL:
+code = com.sun.star.awt.Key.BACKSPACE;
+break;
+case KeyEvent.KEYCODE_ENTER:
+code = com.sun.star.awt.Key.RETURN;
+break;
+default:
+code = keyEvent.getUnicodeChar();
+break;
+}
 mOffice.postKeyEvent(Office.KEY_PRESS, code);
 }
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'feature/tiled-editing' - android/experimental

2015-01-21 Thread Tomaž Vajngerl
 
android/experimental/LOAndroid3/src/java/org/libreoffice/LOKitTileProvider.java 
|2 ++
 1 file changed, 2 insertions(+)

New commits:
commit 54b6849172bbf238753d3fcc76f0add3bb497bc6
Author: Tomaž Vajngerl tomaz.vajng...@collabora.co.uk
Date:   Thu Jan 22 13:53:57 2015 +0900

android: it doesn't hurt to log the document filename on load

Change-Id: I18554052e543a8799ebb45727947a3466b1c793c

diff --git 
a/android/experimental/LOAndroid3/src/java/org/libreoffice/LOKitTileProvider.java
 
b/android/experimental/LOAndroid3/src/java/org/libreoffice/LOKitTileProvider.java
index 78a592b..a6d8d79 100644
--- 
a/android/experimental/LOAndroid3/src/java/org/libreoffice/LOKitTileProvider.java
+++ 
b/android/experimental/LOAndroid3/src/java/org/libreoffice/LOKitTileProvider.java
@@ -49,6 +49,8 @@ public class LOKitTileProvider implements TileProvider, 
Document.MessageCallback
 mOffice = new Office(LibreOfficeKit.getLibreOfficeKitHandle());
 
 mInputFile = input;
+
+Log.i(LOGTAG,  Loading file ' + input + ');
 mDocument = mOffice.documentLoad(input);
 
 if (mDocument == null) {
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'feature/tiled-editing' - android/experimental

2015-01-21 Thread Tomaž Vajngerl
 
android/experimental/LOAndroid3/src/java/org/libreoffice/LibreOfficeMainActivity.java
 |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 24c6a473f923f9d3fe24c81d8887ea30e4f85edd
Author: Tomaž Vajngerl tomaz.vajng...@collabora.co.uk
Date:   Thu Jan 22 13:23:10 2015 +0900

android: Fix loading files that have space in the filename

Change-Id: Icf540bf199b3daf79e4eca9b0a403978b6cae18c

diff --git 
a/android/experimental/LOAndroid3/src/java/org/libreoffice/LibreOfficeMainActivity.java
 
b/android/experimental/LOAndroid3/src/java/org/libreoffice/LibreOfficeMainActivity.java
index 48c46ff..1b20328 100644
--- 
a/android/experimental/LOAndroid3/src/java/org/libreoffice/LibreOfficeMainActivity.java
+++ 
b/android/experimental/LOAndroid3/src/java/org/libreoffice/LibreOfficeMainActivity.java
@@ -96,7 +96,7 @@ public class LibreOfficeMainActivity extends LOAbout {
 LayoutInflater.from(this).setFactory(ViewFactory.getInstance());
 
 if (getIntent().getData() != null) {
-mInputFile = getIntent().getData().getEncodedPath();
+mInputFile = getIntent().getData().getPath();
 } else {
 mInputFile = DEFAULT_DOC_PATH;
 }
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'feature/tiled-editing' - android/experimental

2015-01-21 Thread Miklos Vajna
 android/experimental/LOAndroid3/src/java/org/libreoffice/LOAbout.java |6 
+++---
 1 file changed, 3 insertions(+), 3 deletions(-)

New commits:
commit c562919db2cec7810e8dbaf3a9b8fd4d7b5691ec
Author: Miklos Vajna vmik...@collabora.co.uk
Date:   Wed Jan 21 11:27:05 2015 +0100

android: eliminate hardcoded LibreOfficeMainActivity and package in LOAbout

Change-Id: I276f27a96b4fb970520dec588b9321731e7fc26b

diff --git 
a/android/experimental/LOAndroid3/src/java/org/libreoffice/LOAbout.java 
b/android/experimental/LOAndroid3/src/java/org/libreoffice/LOAbout.java
index 27bb50a..13c436f 100644
--- a/android/experimental/LOAndroid3/src/java/org/libreoffice/LOAbout.java
+++ b/android/experimental/LOAndroid3/src/java/org/libreoffice/LOAbout.java
@@ -39,9 +39,9 @@ public abstract class LOAbout extends Activity {
 private void loadFromAbout(String input) {
 if (mNewActivity) {
 Intent i = new Intent(Intent.ACTION_VIEW, Uri.fromFile(new 
File(input)));
-i.setComponent(new ComponentName(
-org.libreoffice,
-org.libreoffice.LibreOfficeMainActivity));
+String packageName = getApplicationContext().getPackageName();
+ComponentName componentName = new ComponentName(packageName, 
LibreOfficeMainActivity.class.getName());
+i.setComponent(componentName);
 startActivity(i);
 } else {
 LOKitShell.sendEvent(LOEventFactory.close());
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'feature/tiled-editing' - android/experimental

2015-01-21 Thread Miklos Vajna
 
android/experimental/LOAndroid3/src/java/org/libreoffice/LOKitTileProvider.java 
|9 -
 1 file changed, 8 insertions(+), 1 deletion(-)

New commits:
commit b57a321551e65783d083213ada48be91c27e461e
Author: Miklos Vajna vmik...@collabora.co.uk
Date:   Wed Jan 21 14:55:27 2015 +0100

android: fix crash in tile provider while closing the document

The problem was that for large documents if back was pressed quickly,
then we closed the document, but rendering thumbnails for the different
parts was still in progress.

Just make sure we don't crash when the underlying document is gone.

E/AndroidRuntime( 8902): java.lang.NullPointerException
E/AndroidRuntime( 8902):at 
org.libreoffice.LOKitTileProvider.thumbnail(LOKitTileProvider.java:244)
E/AndroidRuntime( 8902):at 
org.libreoffice.ThumbnailCreator$ThumbnailCreationTask.getThumbnail(ThumbnailCreator.java:78)
E/AndroidRuntime( 8902):at 
org.libreoffice.LOKitThread.createThumbnail(LOKitThread.java:170)
E/AndroidRuntime( 8902):at 
org.libreoffice.LOKitThread.processEvent(LOKitThread.java:148)
E/AndroidRuntime( 8902):at 
org.libreoffice.LOKitThread.run(LOKitThread.java:120)

Change-Id: I93e8e1ea19545ca196ef6f59d19528bb42f3676d

diff --git 
a/android/experimental/LOAndroid3/src/java/org/libreoffice/LOKitTileProvider.java
 
b/android/experimental/LOAndroid3/src/java/org/libreoffice/LOKitTileProvider.java
index 0970bbb..78a592b 100644
--- 
a/android/experimental/LOAndroid3/src/java/org/libreoffice/LOKitTileProvider.java
+++ 
b/android/experimental/LOAndroid3/src/java/org/libreoffice/LOKitTileProvider.java
@@ -241,7 +241,8 @@ public class LOKitTileProvider implements TileProvider, 
Document.MessageCallback
 Log.w(LOGTAG, Thumbnail size:  + getPageWidth() +   + 
getPageHeight() +   + widthPixel +   + heightPixel);
 
 ByteBuffer buffer = ByteBuffer.allocateDirect(widthPixel * heightPixel 
* 4);
-mDocument.paintTile(buffer, widthPixel, heightPixel, 0, 0, (int) 
mWidthTwip, (int) mHeightTwip);
+if (mDocument != null)
+mDocument.paintTile(buffer, widthPixel, heightPixel, 0, 0, (int) 
mWidthTwip, (int) mHeightTwip);
 
 Bitmap bitmap = Bitmap.createBitmap(widthPixel, heightPixel, 
Bitmap.Config.ARGB_);
 bitmap.copyPixelsFromBuffer(buffer);
@@ -287,12 +288,18 @@ public class LOKitTileProvider implements TileProvider, 
Document.MessageCallback
 
 @Override
 public void changePart(int partIndex) {
+if (mDocument == null)
+return;
+
 mDocument.setPart(partIndex);
 resetDocumentSize();
 }
 
 @Override
 public int getCurrentPartNumber() {
+if (mDocument == null)
+return 0;
+
 return mDocument.getPart();
 }
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'feature/tiled-editing' - android/experimental

2015-01-20 Thread Miklos Vajna
 android/experimental/LOAndroid3/res/layout/about.xml |2 ++
 1 file changed, 2 insertions(+)

New commits:
commit 19651d7b87835a391b566aa077c28e97c18e3b23
Author: Miklos Vajna vmik...@collabora.co.uk
Date:   Tue Jan 20 18:13:34 2015 +0100

android: make the about dialog scrollable

Content was cut in landscape mode on smaller screens.

Change-Id: Ic3b52da7a4ba9e093946be814afa93226cc34c4b

diff --git a/android/experimental/LOAndroid3/res/layout/about.xml 
b/android/experimental/LOAndroid3/res/layout/about.xml
index 49f707a..9882ab1 100644
--- a/android/experimental/LOAndroid3/res/layout/about.xml
+++ b/android/experimental/LOAndroid3/res/layout/about.xml
@@ -1,5 +1,6 @@
 ?xml version=1.0 encoding=utf-8?
 
+ScrollView
 LinearLayout xmlns:android=http://schemas.android.com/apk/res/android;
   android:layout_width=match_parent
   android:layout_height=match_parent
@@ -43,3 +44,4 @@
 android:textColor=@android:color/secondary_text_light
 android:textSize=18sp/
 /LinearLayout
+/ScrollView
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'feature/tiled-editing' - android/experimental

2015-01-20 Thread Tomaž Vajngerl
 
android/experimental/LOAndroid3/src/java/org/mozilla/gecko/gfx/ComposedTileLayer.java
 |   55 --
 1 file changed, 27 insertions(+), 28 deletions(-)

New commits:
commit 6d64c436a765c4fdfd779497c829892fb21bf8ac
Author: Tomaž Vajngerl tomaz.vajng...@collabora.co.uk
Date:   Wed Jan 21 15:30:54 2015 +0900

Revert android: store tiles in Map for faster access to tiles

This reverts commit 6263bcfd70bf76dbcdf6b7e35bb02e48e44cbd94.

Conflicts:

android/experimental/LOAndroid3/src/java/org/mozilla/gecko/gfx/ComposedTileLayer.java

Change-Id: I2fbd0b67aa3ccf0f629ce4af8788236d297144e5

diff --git 
a/android/experimental/LOAndroid3/src/java/org/mozilla/gecko/gfx/ComposedTileLayer.java
 
b/android/experimental/LOAndroid3/src/java/org/mozilla/gecko/gfx/ComposedTileLayer.java
index d917c03..ca25438 100644
--- 
a/android/experimental/LOAndroid3/src/java/org/mozilla/gecko/gfx/ComposedTileLayer.java
+++ 
b/android/experimental/LOAndroid3/src/java/org/mozilla/gecko/gfx/ComposedTileLayer.java
@@ -14,18 +14,14 @@ import org.libreoffice.LOKitShell;
 import org.libreoffice.TileIdentifier;
 import org.mozilla.gecko.util.FloatUtils;
 
-import java.util.Collections;
-import java.util.Iterator;
-import java.util.Map;
-import java.util.Set;
-import java.util.concurrent.ConcurrentHashMap;
-import java.util.concurrent.ConcurrentMap;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.concurrent.CopyOnWriteArrayList;
 
 public abstract class ComposedTileLayer extends Layer implements 
ComponentCallbacks2 {
 private static final String LOGTAG = 
ComposedTileLayer.class.getSimpleName();
 
-protected final ConcurrentMapTileIdentifier, SubTile tiles = new 
ConcurrentHashMapTileIdentifier, SubTile();
-protected final SetTileIdentifier newTileIds = 
Collections.newSetFromMap(new ConcurrentHashMapTileIdentifier, Boolean());
+protected final ListSubTile tiles = new CopyOnWriteArrayListSubTile();
 
 protected final IntSize tileSize;
 protected RectF currentViewport = new RectF();
@@ -37,7 +33,7 @@ public abstract class ComposedTileLayer extends Layer 
implements ComponentCallba
 }
 
 public void invalidate() {
-for (SubTile tile : tiles.values()) {
+for (SubTile tile : tiles) {
 tile.invalidate();
 }
 }
@@ -45,14 +41,14 @@ public abstract class ComposedTileLayer extends Layer 
implements ComponentCallba
 @Override
 public void beginTransaction() {
 super.beginTransaction();
-for (SubTile tile : tiles.values()) {
+for (SubTile tile : tiles) {
 tile.beginTransaction();
 }
 }
 
 @Override
 public void endTransaction() {
-for (SubTile tile : tiles.values()) {
+for (SubTile tile : tiles) {
 tile.endTransaction();
 }
 super.endTransaction();
@@ -60,7 +56,7 @@ public abstract class ComposedTileLayer extends Layer 
implements ComponentCallba
 
 @Override
 public void draw(RenderContext context) {
-for (SubTile tile : tiles.values()) {
+for (SubTile tile : tiles) {
 if (RectF.intersects(tile.getBounds(context), context.viewport)) {
 tile.draw(context);
 }
@@ -71,7 +67,7 @@ public abstract class ComposedTileLayer extends Layer 
implements ComponentCallba
 protected void performUpdates(RenderContext context) {
 super.performUpdates(context);
 
-for (SubTile tile : tiles.values()) {
+for (SubTile tile : tiles) {
 tile.beginTransaction();
 tile.refreshTileMetrics();
 tile.endTransaction();
@@ -82,7 +78,7 @@ public abstract class ComposedTileLayer extends Layer 
implements ComponentCallba
 @Override
 public Region getValidRegion(RenderContext context) {
 Region validRegion = new Region();
-for (SubTile tile : tiles.values()) {
+for (SubTile tile : tiles) {
 validRegion.op(tile.getValidRegion(context), Region.Op.UNION);
 }
 
@@ -92,7 +88,7 @@ public abstract class ComposedTileLayer extends Layer 
implements ComponentCallba
 @Override
 public void setResolution(float newResolution) {
 super.setResolution(newResolution);
-for (SubTile tile : tiles.values()) {
+for (SubTile tile : tiles) {
 tile.setResolution(newResolution);
 }
 }
@@ -159,9 +155,14 @@ public abstract class ComposedTileLayer extends Layer 
implements ComponentCallba
 if (x  pageRect.width()) {
 continue;
 }
-TileIdentifier tileId = new TileIdentifier((int) x, (int) y, 
currentZoom, tileSize);
-if (!tiles.containsKey(tileId)  
!newTileIds.contains(tileId)) {
-newTileIds.add(tileId);
+boolean contains = false;
+for (SubTile tile : tiles) {
+if (tile.id.x == x  tile.id.y 

[Libreoffice-commits] core.git: Branch 'feature/tiled-editing' - android/experimental configure.ac

2015-01-19 Thread Miklos Vajna
 android/experimental/LOAndroid3/AndroidManifest.xml.in |2 -
 configure.ac   |   22 +
 2 files changed, 23 insertions(+), 1 deletion(-)

New commits:
commit 348bd4d2ab51e173738d7a299c4415f5f13ef401
Author: Miklos Vajna vmik...@collabora.co.uk
Date:   Mon Jan 19 15:13:51 2015 +0100

android: make package name configurable

Change-Id: I3897c551676bcb7d3237be3dde74123c5ddd8f84

diff --git a/android/experimental/LOAndroid3/AndroidManifest.xml.in 
b/android/experimental/LOAndroid3/AndroidManifest.xml.in
index 360687e..118555f 100644
--- a/android/experimental/LOAndroid3/AndroidManifest.xml.in
+++ b/android/experimental/LOAndroid3/AndroidManifest.xml.in
@@ -1,6 +1,6 @@
 ?xml version=1.0 encoding=utf-8?
 manifest xmlns:android=http://schemas.android.com/apk/res/android;
-package=org.libreoffice
+package=@ANDROID_PACKAGE_NAME@
 @ANDROID_INSTALL_LOCATION@
 android:versionCode=1
 android:versionName=@ANDROID_VERSION@
diff --git a/configure.ac b/configure.ac
index b147aa8..a700420 100644
--- a/configure.ac
+++ b/configure.ac
@@ -2128,6 +2128,14 @@ AC_ARG_WITH(vendor,
 ],
 ,)
 
+AC_ARG_WITH(android-package-name,
+AS_HELP_STRING([--with-android-package-name],
+[Set Android package name of the build.])
+[
+  Usage: 
--with-android-package-name=org.libreoffice
+],
+,)
+
 AC_ARG_WITH(compat-oowrappers,
 AS_HELP_STRING([--with-compat-oowrappers],
 [Install oo* wrappers in parallel with
@@ -12302,6 +12310,20 @@ else
 fi
 AC_SUBST(OOO_VENDOR)
 
+if echo $host_os | grep -q linux-android ; then
+ANDROID_PACKAGE_NAME=
+AC_MSG_CHECKING([for Android package name])
+if test -z $with_android_package_name -o $with_android_package_name = 
no; then
+ANDROID_PACKAGE_NAME=org.libreoffice
+
+AC_MSG_RESULT([not set, using $ANDROID_PACKAGE_NAME])
+else
+ANDROID_PACKAGE_NAME=$with_android_package_name
+AC_MSG_RESULT([$ANDROID_PACKAGE_NAME])
+fi
+AC_SUBST(ANDROID_PACKAGE_NAME)
+fi
+
 AC_MSG_CHECKING([whether to install the compat oo* wrappers])
 if test $with_compat_oowrappers = yes; then
 WITH_COMPAT_OOWRAPPERS=TRUE
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'feature/tiled-editing' - android/experimental

2015-01-19 Thread Tomaž Vajngerl
 android/experimental/LOAndroid3/AndroidManifest.xml.in |   16 +---
 1 file changed, 9 insertions(+), 7 deletions(-)

New commits:
commit 3030407540486e9faa6cdf7e1a01d94efe54c5db
Author: Tomaž Vajngerl tomaz.vajng...@collabora.co.uk
Date:   Mon Jan 19 23:12:17 2015 +0900

android: re-enable calc documents associations with LO viewer

Change-Id: I89424e575a926c189be499e5fe2b811817ccd2fb

diff --git a/android/experimental/LOAndroid3/AndroidManifest.xml.in 
b/android/experimental/LOAndroid3/AndroidManifest.xml.in
index 118555f..0bb8333 100644
--- a/android/experimental/LOAndroid3/AndroidManifest.xml.in
+++ b/android/experimental/LOAndroid3/AndroidManifest.xml.in
@@ -34,15 +34,17 @@
 data 
android:mimeType=application/vnd.oasis.opendocument.text /
 data 
android:mimeType=application/vnd.oasis.opendocument.graphics /
 data 
android:mimeType=application/vnd.oasis.opendocument.presentation /
-!-- Calc. data 
android:mimeType=application/vnd.oasis.opendocument.spreadsheet/ --
+data 
android:mimeType=application/vnd.oasis.opendocument.spreadsheet/
 data 
android:mimeType=application/vnd.oasis.opendocument.text-flat-xml /
 data 
android:mimeType=application/vnd.oasis.opendocument.graphics-flat-xml /
 data 
android:mimeType=application/vnd.oasis.opendocument.presentation-flat-xml /
-!-- Calc. data 
android:mimeType=application/vnd.oasis.opendocument.spreadsheet-flat-xml / 
--
+!-- TODO: opening FODS documents crashes currently  
+data 
android:mimeType=application/vnd.oasis.opendocument.spreadsheet-flat-xml /
+--
 
 !-- ODF templates --
 data 
android:mimeType=application/vnd.oasis.opendocument.text-template/
-!-- Calc. data 
android:mimeType=application/vnd.oasis.opendocument.spreadsheet-template/ --
+data 
android:mimeType=application/vnd.oasis.opendocument.spreadsheet-template/
 data 
android:mimeType=application/vnd.oasis.opendocument.graphics-template/
 !-- Seems at least Anroid 5.0 does not recognize this as the 
mime type of .otp files. --
 data 
android:mimeType=application/vnd.oasis.opendocument.presentation-template/
@@ -52,24 +54,24 @@
 data android:mimeType=text/rtf /
 data android:mimeType=application/msword /
 data android:mimeType=application/vnd.ms-powerpoint /
-!-- Calc. data android:mimeType=application/vnd.ms-excel/ 
--
+data android:mimeType=application/vnd.ms-excel/
 data android:mimeType=application/vnd.visio /
 data android:mimeType=application/vnd.visio.xml /
 data android:mimeType=application/x-mspublisher /
 
 !-- OOXML --
-!-- Calc. data 
android:mimeType=application/vnd.openxmlformats-officedocument.spreadsheetml.sheet
 / --
+data 
android:mimeType=application/vnd.openxmlformats-officedocument.spreadsheetml.sheet
 /
 data 
android:mimeType=application/vnd.openxmlformats-officedocument.presentationml.presentation
 /
 !-- Currently crashes. data 
android:mimeType=application/vnd.openxmlformats-officedocument.presentationml.slideshow/
 --
 data 
android:mimeType=application/vnd.openxmlformats-officedocument.wordprocessingml.document
 /
 
 !-- OOXML templates --
 data 
android:mimeType=application/vnd.openxmlformats-officedocument.wordprocessingml.template/
-!-- Calc. data 
android:mimeType=application/vnd.openxmlformats-officedocument.spreadsheetml.template/
 --
+data 
android:mimeType=application/vnd.openxmlformats-officedocument.spreadsheetml.template/
 data 
android:mimeType=application/vnd.openxmlformats-officedocument.presentationml.template/
 
 !-- OTHER --
-!-- Calc. data android:mimeType=text/csv/--
+data android:mimeType=text/csv/
 data android:mimeType=application/vnd.ms-works /
 data android:mimeType=application/vnd.apple.keynote /
 data android:mimeType=application/x-abiword /
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'feature/tiled-editing' - android/experimental

2015-01-19 Thread Miklos Vajna
 android/experimental/LOAndroid3/res/values/arrays.xml  
|2 -
 android/experimental/LOAndroid3/src/java/org/libreoffice/ui/FileUtilities.java 
|   20 +-
 
android/experimental/LOAndroid3/src/java/org/libreoffice/ui/GridItemAdapter.java
   |4 +-
 
android/experimental/LOAndroid3/src/java/org/libreoffice/ui/LibreOfficeUIActivity.java
 |4 +-
 
android/experimental/LOAndroid3/src/java/org/libreoffice/ui/ListItemAdapter.java
   |4 +-
 5 files changed, 17 insertions(+), 17 deletions(-)

New commits:
commit c5c5317f64c09e7b8cdf335f6ab1dd79da0471b7
Author: Miklos Vajna vmik...@collabora.co.uk
Date:   Mon Jan 19 16:08:44 2015 +0100

android: adapt doc browser to updated manifest that accepts Calc documents

Change-Id: I5398e225631097b31aa4f8418ffa40a6db323a42

diff --git a/android/experimental/LOAndroid3/res/values/arrays.xml 
b/android/experimental/LOAndroid3/res/values/arrays.xml
index 2263b47..28849af 100644
--- a/android/experimental/LOAndroid3/res/values/arrays.xml
+++ b/android/experimental/LOAndroid3/res/values/arrays.xml
@@ -35,7 +35,7 @@
 string-array name=file_view_modes
 item EVERYTHING/item
 item DOCUMENTS/item
-!-- itemSPREADSHEETS/item --
+itemSPREADSHEETS/item
 item PRESENTATIONS/item
 itemDRAWINGS/item
 /string-array
diff --git 
a/android/experimental/LOAndroid3/src/java/org/libreoffice/ui/FileUtilities.java
 
b/android/experimental/LOAndroid3/src/java/org/libreoffice/ui/FileUtilities.java
index 3c67947..f658d92 100644
--- 
a/android/experimental/LOAndroid3/src/java/org/libreoffice/ui/FileUtilities.java
+++ 
b/android/experimental/LOAndroid3/src/java/org/libreoffice/ui/FileUtilities.java
@@ -24,9 +24,9 @@ public class FileUtilities {
 
 // These have to be in sync with the file_view_modes resource.
 static final int DOC = 0;
-// static final int CALC = 1;
-static final int IMPRESS = 1;
-static final int DRAWING = 2;
+static final int CALC = 1;
+static final int IMPRESS = 2;
+static final int DRAWING = 3;
 
 static final int UNKNOWN = 10;
 
@@ -49,7 +49,7 @@ public class FileUtilities {
 mExtnMap.put(.odt, DOC);
 mExtnMap.put(.odg, DRAWING);
 mExtnMap.put(.odp,  IMPRESS);
-// mExtnMap.put(.ods,  CALC);
+mExtnMap.put(.ods,  CALC);
 mExtnMap.put(.fodt, DOC);
 mExtnMap.put(.fodg, DRAWING);
 mExtnMap.put(.fodp,  IMPRESS);
@@ -59,7 +59,7 @@ public class FileUtilities {
 mExtnMap.put(.ott, DOC);
 mExtnMap.put(.otg, DRAWING);
 mExtnMap.put(.otp,  IMPRESS);
-// mExtnMap.put(.ots,  CALC);
+mExtnMap.put(.ots,  CALC);
 
 // MS
 mExtnMap.put(.rtf,  DOC);
@@ -69,26 +69,26 @@ public class FileUtilities {
 mExtnMap.put(.pub, DRAWING);
 mExtnMap.put(.ppt,  IMPRESS);
 // mExtnMap.put(.pps,  IMPRESS);
-// mExtnMap.put(.xls,  CALC);
+mExtnMap.put(.xls,  CALC);
 
 // MS templates
 mExtnMap.put(.dot,  DOC);
 mExtnMap.put(.pot,  IMPRESS);
-// mExtnMap.put(.xlt,  CALC);
+mExtnMap.put(.xlt,  CALC);
 
 // OOXML
 mExtnMap.put(.docx, DOC);
 mExtnMap.put(.pptx, IMPRESS);
 // mExtnMap.put(.ppsx, IMPRESS);
-// mExtnMap.put(.xlsx, CALC);
+mExtnMap.put(.xlsx, CALC);
 
 // OOXML templates
 mExtnMap.put(.dotx, DOC);
 mExtnMap.put(.potx, IMPRESS);
-// mExtnMap.put(.xltx, CALC);
+mExtnMap.put(.xltx, CALC);
 
 // Other
-//mExtnMap.put(.csv,  CALC);
+mExtnMap.put(.csv,  CALC);
 mExtnMap.put(.wps,  DOC);
 mExtnMap.put(.key,  IMPRESS);
 mExtnMap.put(.abw,  DOC);
diff --git 
a/android/experimental/LOAndroid3/src/java/org/libreoffice/ui/GridItemAdapter.java
 
b/android/experimental/LOAndroid3/src/java/org/libreoffice/ui/GridItemAdapter.java
index d0470e7..22f7b9b 100644
--- 
a/android/experimental/LOAndroid3/src/java/org/libreoffice/ui/GridItemAdapter.java
+++ 
b/android/experimental/LOAndroid3/src/java/org/libreoffice/ui/GridItemAdapter.java
@@ -127,9 +127,9 @@ public class GridItemAdapter extends BaseAdapter {
 }
 imageView.setImageResource(R.drawable.writer);
 break;
-/*case FileUtilities.CALC:
+case FileUtilities.CALC:
 imageView.setImageResource(R.drawable.calc);
-break;*/
+break;
 case FileUtilities.DRAWING: // FIXME: only for now ...
 case FileUtilities.IMPRESS:
 imageView.setImageResource(R.drawable.impress);
diff --git 
a/android/experimental/LOAndroid3/src/java/org/libreoffice/ui/LibreOfficeUIActivity.java
 
b/android/experimental/LOAndroid3/src/java/org/libreoffice/ui/LibreOfficeUIActivity.java
index 61f8450..4b35ba3 100644
--- 

[Libreoffice-commits] core.git: Branch 'feature/tiled-editing' - android/experimental

2015-01-16 Thread Tomaž Vajngerl
 
android/experimental/LOAndroid3/src/java/org/mozilla/gecko/gfx/GeckoLayerClient.java
 |   46 +++---
 1 file changed, 16 insertions(+), 30 deletions(-)

New commits:
commit fab02dacc38ccfedac3ed2c049d8493367fb8ebf
Author: Tomaž Vajngerl tomaz.vajng...@collabora.co.uk
Date:   Fri Jan 16 21:20:22 2015 +0900

android: cleanup GeckoLayerClient

Change-Id: If9a7c50249c9e44dce1a8e3c02a8b2f568dedfb1

diff --git 
a/android/experimental/LOAndroid3/src/java/org/mozilla/gecko/gfx/GeckoLayerClient.java
 
b/android/experimental/LOAndroid3/src/java/org/mozilla/gecko/gfx/GeckoLayerClient.java
index 3e70698..1006383 100644
--- 
a/android/experimental/LOAndroid3/src/java/org/mozilla/gecko/gfx/GeckoLayerClient.java
+++ 
b/android/experimental/LOAndroid3/src/java/org/mozilla/gecko/gfx/GeckoLayerClient.java
@@ -147,10 +147,6 @@ public class GeckoLayerClient implements PanZoomTarget, 
LayerView.Listener {
 return mView;
 }
 
-public FloatSize getViewportSize() {
-return mViewportMetrics.getSize();
-}
-
 /**
  * The view calls this function to indicate that the viewport changed 
size. It must hold the
  * monitor while calling it.
@@ -220,7 +216,7 @@ public class GeckoLayerClient implements PanZoomTarget, 
LayerView.Listener {
 ImmutableViewportMetrics clampedMetrics = metrics.clamp();
 
 if (displayPort == null) {
-displayPort = DisplayPortCalculator.calculate(metrics, 
getPanZoomController().getVelocityVector());
+displayPort = DisplayPortCalculator.calculate(metrics, 
mPanZoomController.getVelocityVector());
 }
 
 mDisplayPort = displayPort;
@@ -280,7 +276,7 @@ public class GeckoLayerClient implements PanZoomTarget, 
LayerView.Listener {
 synchronized (this) {
 try {
 mNewGeckoViewport = viewportMetrics;
-updateViewport(true);
+updateViewport();
 mLowResLayer.invalidate();
 mRootLayer.invalidate();
 } finally {
@@ -290,12 +286,12 @@ public class GeckoLayerClient implements PanZoomTarget, 
LayerView.Listener {
 }
 }
 
-protected void updateViewport(boolean onlyUpdatePageSize) {
+protected void updateViewport() {
 // save and restore the viewport size stored in java; never let the
 // JS-side viewport dimensions override the java-side ones because
 // java is the One True Source of this information, and allowing JS
 // to override can lead to race conditions where this data gets 
clobbered.
-FloatSize viewportSize = getViewportSize();
+FloatSize viewportSize = mViewportMetrics.getSize();
 mGeckoViewport = mNewGeckoViewport.setViewportSize(viewportSize.width, 
viewportSize.height);
 
 RectF position = mGeckoViewport.getViewport();
@@ -305,15 +301,10 @@ public class GeckoLayerClient implements PanZoomTarget, 
LayerView.Listener {
 mLowResLayer.setPosition(RectUtils.round(position));
 mLowResLayer.setResolution(mGeckoViewport.zoomFactor);
 
-if (onlyUpdatePageSize) {
-// Don't adjust page size when zooming unless zoom levels are
-// approximately equal.
-if (FloatUtils.fuzzyEquals(getViewportMetrics().zoomFactor, 
mGeckoViewport.zoomFactor)) {
-setPageRect(mGeckoViewport.getPageRect(), 
mGeckoViewport.getCssPageRect());
-}
-} else {
-setViewportMetrics(mGeckoViewport);
-abortPanZoomAnimation();
+// Don't adjust page size when zooming unless zoom levels are
+// approximately equal.
+if (FloatUtils.fuzzyEquals(getViewportMetrics().zoomFactor, 
mGeckoViewport.zoomFactor)) {
+setPageRect(mGeckoViewport.getPageRect(), 
mGeckoViewport.getCssPageRect());
 }
 }
 
@@ -397,14 +388,6 @@ public class GeckoLayerClient implements PanZoomTarget, 
LayerView.Listener {
 }
 }
 
-public void forceRender() {
-post(new Runnable() {
-public void run() {
-mView.requestRender();
-}
-});
-}
-
 /** Implementation of PanZoomTarget */
 public boolean post(Runnable action) {
 return mView.post(action);
@@ -446,10 +429,6 @@ public class GeckoLayerClient implements PanZoomTarget, 
LayerView.Listener {
 return layerPoint;
 }
 
-public ImmutableViewportMetrics getGeckoViewportMetrics() {
-return mGeckoViewport;
-}
-
 public void destroy() {
 mPanZoomController.destroy();
 }
@@ -458,7 +437,6 @@ public class GeckoLayerClient implements PanZoomTarget, 
LayerView.Listener {
 return mContext;
 }
 
-
 public void zoomTo(RectF rect) {
 if (mPanZoomController instanceof JavaPanZoomController) {
 ((JavaPanZoomController) mPanZoomController).animatedZoomTo(rect);
@@ -469,6 +447,14 @@ public class GeckoLayerClient implements 

[Libreoffice-commits] core.git: Branch 'feature/tiled-editing' - android/experimental

2015-01-16 Thread Tomaž Vajngerl
 
android/experimental/LOAndroid3/src/java/org/mozilla/gecko/gfx/ComposedTileLayer.java
 |8 ++--
 1 file changed, 2 insertions(+), 6 deletions(-)

New commits:
commit ce877897fb5fc2f858c302f925d4609c068568da
Author: Tomaž Vajngerl tomaz.vajng...@collabora.co.uk
Date:   Fri Jan 16 23:21:07 2015 +0900

android: fix invalidation rect calculation in ComposedTileLayer

Change-Id: I5e0a59d6b966daea2a2033b0f52dc6983b837ca1

diff --git 
a/android/experimental/LOAndroid3/src/java/org/mozilla/gecko/gfx/ComposedTileLayer.java
 
b/android/experimental/LOAndroid3/src/java/org/mozilla/gecko/gfx/ComposedTileLayer.java
index d0fe36a..e169056 100644
--- 
a/android/experimental/LOAndroid3/src/java/org/mozilla/gecko/gfx/ComposedTileLayer.java
+++ 
b/android/experimental/LOAndroid3/src/java/org/mozilla/gecko/gfx/ComposedTileLayer.java
@@ -134,9 +134,6 @@ public abstract class ComposedTileLayer extends Layer 
implements ComponentCallba
 float newZoom = getZoom(viewportMetrics);
 
 if (!currentViewport.equals(newCurrentViewPort) || currentZoom != 
newZoom) {
-if (newZoom == 1.0f) {
-Log.i(LOGTAG, Suspisious zoom 1.0);
-}
 currentViewport = newCurrentViewPort;
 currentZoom = newZoom;
 RectF pageRect = viewportMetrics.getPageRect();
@@ -216,10 +213,9 @@ public abstract class ComposedTileLayer extends Layer 
implements ComponentCallba
  * Invalidate tiles which intersect the input rect
  */
 public void invalidateTiles(RectF rect) {
-RectF zoomedRect = RectUtils.inverseScale(rect, currentZoom);
-
+RectF zoomedRect = RectUtils.scale(rect, currentZoom);
 for (SubTile tile : tiles.values()) {
-if (RectF.intersects(rect, tile.id.getRect())) {
+if (RectF.intersects(zoomedRect, tile.id.getRect())) {
 LOKitShell.sendEvent(LOEventFactory.tileRerender(this, tile));
 }
 }
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'feature/tiled-editing' - android/experimental

2015-01-15 Thread Tomaž Vajngerl
 android/experimental/LOAndroid3/src/java/org/libreoffice/LOKitThread.java |
7 +--
 1 file changed, 1 insertion(+), 6 deletions(-)

New commits:
commit e3a4316f018bc55fb2e9ba374b3b7ae9b2b7c178
Author: Tomaž Vajngerl tomaz.vajng...@collabora.co.uk
Date:   Fri Jan 16 16:02:38 2015 +0900

android: remove invalidation registration on touch for now

Change-Id: I7b3acba83de0c17bd4723fb6623827dbbb82fbbf

diff --git 
a/android/experimental/LOAndroid3/src/java/org/libreoffice/LOKitThread.java 
b/android/experimental/LOAndroid3/src/java/org/libreoffice/LOKitThread.java
index ed89536..32cb43c 100644
--- a/android/experimental/LOAndroid3/src/java/org/libreoffice/LOKitThread.java
+++ b/android/experimental/LOAndroid3/src/java/org/libreoffice/LOKitThread.java
@@ -22,7 +22,6 @@ public class LOKitThread extends Thread implements 
TileProvider.TileInvalidation
 private TileProvider mTileProvider;
 private ImmutableViewportMetrics mViewportMetrics;
 private GeckoLayerClient mLayerClient;
-private boolean mInvalidationCallbackRegistered = false;
 
 public LOKitThread() {
 TileProviderFactory.initialize();
@@ -99,9 +98,9 @@ public class LOKitThread extends Thread implements 
TileProvider.TileInvalidation
 boolean isReady = mTileProvider.isReady();
 if (isReady) {
 LOKitShell.showProgressSpinner();
+mTileProvider.registerInvalidationCallback(this);
 refresh();
 LOKitShell.hideProgressSpinner();
-mInvalidationCallbackRegistered = false;
 }
 return isReady;
 }
@@ -153,10 +152,6 @@ public class LOKitThread extends Thread implements 
TileProvider.TileInvalidation
 
 private void touch(String touchType, MotionEvent motionEvent) {
 LibreOfficeMainActivity.mAppContext.showSoftKeyboard();
-if (!mInvalidationCallbackRegistered) {
-mTileProvider.registerInvalidationCallback(this);
-mInvalidationCallbackRegistered = true;
-}
 }
 
 private void createThumbnail(final ThumbnailCreator.ThumbnailCreationTask 
task) {
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'feature/tiled-editing' - android/experimental

2015-01-15 Thread Tomaž Vajngerl
 android/experimental/LOAndroid3/src/java/org/libreoffice/LOKitThread.java  
 |   17 --
 
android/experimental/LOAndroid3/src/java/org/libreoffice/LOKitTileProvider.java 
|4 --
 2 files changed, 15 insertions(+), 6 deletions(-)

New commits:
commit 04a84ecf8dcc303547ef9cddd75e0b8f0b33a2fe
Author: Tomaž Vajngerl tomaz.vajng...@collabora.co.uk
Date:   Thu Jan 15 18:40:49 2015 +0900

android: register invalidtion callback on first touch

Change-Id: I3a98358934b79a2ace574714aa331fdce4a421bb

diff --git 
a/android/experimental/LOAndroid3/src/java/org/libreoffice/LOKitThread.java 
b/android/experimental/LOAndroid3/src/java/org/libreoffice/LOKitThread.java
index 30af98d..ed89536 100644
--- a/android/experimental/LOAndroid3/src/java/org/libreoffice/LOKitThread.java
+++ b/android/experimental/LOAndroid3/src/java/org/libreoffice/LOKitThread.java
@@ -4,6 +4,7 @@ import android.graphics.Bitmap;
 import android.graphics.PointF;
 import android.graphics.RectF;
 import android.util.Log;
+import android.view.MotionEvent;
 
 import org.mozilla.gecko.gfx.CairoImage;
 import org.mozilla.gecko.gfx.ComposedTileLayer;
@@ -21,6 +22,7 @@ public class LOKitThread extends Thread implements 
TileProvider.TileInvalidation
 private TileProvider mTileProvider;
 private ImmutableViewportMetrics mViewportMetrics;
 private GeckoLayerClient mLayerClient;
+private boolean mInvalidationCallbackRegistered = false;
 
 public LOKitThread() {
 TileProviderFactory.initialize();
@@ -97,11 +99,10 @@ public class LOKitThread extends Thread implements 
TileProvider.TileInvalidation
 boolean isReady = mTileProvider.isReady();
 if (isReady) {
 LOKitShell.showProgressSpinner();
-mTileProvider.registerInvalidationCallback(this);
 refresh();
 LOKitShell.hideProgressSpinner();
+mInvalidationCallbackRegistered = false;
 }
-
 return isReady;
 }
 
@@ -143,8 +144,18 @@ public class LOKitThread extends Thread implements 
TileProvider.TileInvalidation
 break;
 case LOEvent.THUMBNAIL:
 createThumbnail(event.mTask);
+break;
 case LOEvent.TOUCH:
-LibreOfficeMainActivity.mAppContext.showSoftKeyboard();
+touch(event.mTouchType, event.mMotionEvent);
+break;
+}
+}
+
+private void touch(String touchType, MotionEvent motionEvent) {
+LibreOfficeMainActivity.mAppContext.showSoftKeyboard();
+if (!mInvalidationCallbackRegistered) {
+mTileProvider.registerInvalidationCallback(this);
+mInvalidationCallbackRegistered = true;
 }
 }
 
diff --git 
a/android/experimental/LOAndroid3/src/java/org/libreoffice/LOKitTileProvider.java
 
b/android/experimental/LOAndroid3/src/java/org/libreoffice/LOKitTileProvider.java
index 752e0a9..9334536 100644
--- 
a/android/experimental/LOAndroid3/src/java/org/libreoffice/LOKitTileProvider.java
+++ 
b/android/experimental/LOAndroid3/src/java/org/libreoffice/LOKitTileProvider.java
@@ -70,8 +70,7 @@ public class LOKitTileProvider implements TileProvider, 
Document.MessageCallback
 
 public void postLoad() {
 mDocument.initializeForRendering();
-// FIXME see gtktiledviewer, this has to be registered when we enter 
edit mode, not right after loading.
-// mDocument.setMessageCallback(this);
+mDocument.setMessageCallback(this);
 
 int parts = mDocument.getParts();
 Log.i(LOGTAG, Document parts:  + parts);
@@ -303,7 +302,6 @@ public class LOKitTileProvider implements TileProvider, 
Document.MessageCallback
 twipToPixel(x + width, mDPI),
 twipToPixel(y + height, mDPI)
 );
-Log.i(LOGTAG, Invalidate R:  + rect + -  + 
getPageWidth() +   + getPageHeight());
 tileInvalidationCallback.invalidate(rect);
 }
 }
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'feature/tiled-editing' - android/experimental

2015-01-13 Thread Miklos Vajna
 
android/experimental/LOAndroid3/src/java/org/libreoffice/LOKitTileProvider.java 
|2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit a71e4daad9cde44ac7896ae4488d61d17fedc796
Author: Miklos Vajna vmik...@collabora.co.uk
Date:   Tue Jan 13 12:48:58 2015 +0100

android: if we don't have a document, then that can't be text

Change-Id: I2b9e37aec2705ab723c11a0d1eb795aa5a63105e

diff --git 
a/android/experimental/LOAndroid3/src/java/org/libreoffice/LOKitTileProvider.java
 
b/android/experimental/LOAndroid3/src/java/org/libreoffice/LOKitTileProvider.java
index fe389ef..8f4e56e 100644
--- 
a/android/experimental/LOAndroid3/src/java/org/libreoffice/LOKitTileProvider.java
+++ 
b/android/experimental/LOAndroid3/src/java/org/libreoffice/LOKitTileProvider.java
@@ -254,7 +254,7 @@ public class LOKitTileProvider implements TileProvider, 
Document.MessageCallback
 
 @Override
 public boolean isTextDocument() {
-return mDocument.getDocumentType() == Document.DOCTYPE_TEXT;
+return mDocument != null  mDocument.getDocumentType() == 
Document.DOCTYPE_TEXT;
 }
 
 @Override
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'feature/tiled-editing' - android/experimental

2015-01-13 Thread Miklos Vajna
 
android/experimental/LOAndroid3/src/java/org/libreoffice/LOKitTileProvider.java 
|3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

New commits:
commit 20631c2743b7aa54fe0f00d17ee37f7422e3e7ee
Author: Miklos Vajna vmik...@collabora.co.uk
Date:   Tue Jan 13 17:12:13 2015 +0100

android: avoid setMessageCallback() for now

This has to be only called when the user taps, not before. Don't do it
at all till we figure out how to detect a tap.

Change-Id: I184442d3f06fcbf56f0789bb85693dd7273daf28

diff --git 
a/android/experimental/LOAndroid3/src/java/org/libreoffice/LOKitTileProvider.java
 
b/android/experimental/LOAndroid3/src/java/org/libreoffice/LOKitTileProvider.java
index 8f4e56e..0e2db4b 100644
--- 
a/android/experimental/LOAndroid3/src/java/org/libreoffice/LOKitTileProvider.java
+++ 
b/android/experimental/LOAndroid3/src/java/org/libreoffice/LOKitTileProvider.java
@@ -69,7 +69,8 @@ public class LOKitTileProvider implements TileProvider, 
Document.MessageCallback
 
 public void postLoad() {
 mDocument.initializeForRendering();
-mDocument.setMessageCallback(this);
+// FIXME see gtktiledviewer, this has to be registered when we enter 
edit mode, not right after loading.
+// mDocument.setMessageCallback(this);
 
 int parts = mDocument.getParts();
 Log.i(LOGTAG, Document parts:  + parts);
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'feature/tiled-editing' - android/experimental

2015-01-13 Thread Tomaž Vajngerl
 
android/experimental/LOAndroid3/src/java/org/mozilla/gecko/gfx/ComposedTileLayer.java
 |6 +-
 
android/experimental/LOAndroid3/src/java/org/mozilla/gecko/gfx/DynamicTileLayer.java
  |4 ++--
 2 files changed, 7 insertions(+), 3 deletions(-)

New commits:
commit 3ac52a60d570fb8afb3d8ad063e35f0667b385cb
Author: Tomaž Vajngerl tomaz.vajng...@collabora.co.uk
Date:   Wed Jan 14 09:09:05 2015 +0900

android: Inflate viewport even more to render more tiles offscreen

Change-Id: I6a1f8bb8fd04e40ecd60eec87043e507ca6350e7

diff --git 
a/android/experimental/LOAndroid3/src/java/org/mozilla/gecko/gfx/ComposedTileLayer.java
 
b/android/experimental/LOAndroid3/src/java/org/mozilla/gecko/gfx/ComposedTileLayer.java
index 1a67117..31c7a07 100644
--- 
a/android/experimental/LOAndroid3/src/java/org/mozilla/gecko/gfx/ComposedTileLayer.java
+++ 
b/android/experimental/LOAndroid3/src/java/org/mozilla/gecko/gfx/ComposedTileLayer.java
@@ -165,7 +165,8 @@ public abstract class ComposedTileLayer extends Layer {
 }
 }
 if (!contains) {
-LOEvent event = LOEventFactory.tileRequest(this, new 
TileIdentifier((int) x, (int) y, zoom, tileSize), false);
+TileIdentifier tileId = new TileIdentifier((int) x, (int) 
y, zoom, tileSize);
+LOEvent event = LOEventFactory.tileRequest(this, tileId, 
true);
 event.mPriority = getTilePriority();
 LOKitShell.sendEvent(event);
 }
@@ -212,6 +213,9 @@ public abstract class ComposedTileLayer extends Layer {
 return RectF.intersects(currentViewport, tileId.getRect()) || 
currentViewport.contains(tileId.getRect());
 }
 
+/**
+ * Invalidate tiles which intersect the input rect
+ */
 public void invalidateTiles(RectF rect) {
 RectF zoomedRect = RectUtils.inverseScale(rect, currentZoom);
 
diff --git 
a/android/experimental/LOAndroid3/src/java/org/mozilla/gecko/gfx/DynamicTileLayer.java
 
b/android/experimental/LOAndroid3/src/java/org/mozilla/gecko/gfx/DynamicTileLayer.java
index 12ff723..38d6d80 100644
--- 
a/android/experimental/LOAndroid3/src/java/org/mozilla/gecko/gfx/DynamicTileLayer.java
+++ 
b/android/experimental/LOAndroid3/src/java/org/mozilla/gecko/gfx/DynamicTileLayer.java
@@ -19,7 +19,7 @@ public class DynamicTileLayer extends ComposedTileLayer {
 return 0;
 }
 
-protected IntSize getInflateFactor() {
-return tileSize;
+private IntSize getInflateFactor() {
+return new IntSize(tileSize.width*2, tileSize.height*4);
 }
 }
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'feature/tiled-editing' - android/experimental

2015-01-09 Thread Tomaž Vajngerl
 
android/experimental/LOAndroid3/src/java/org/libreoffice/LOKitTileProvider.java 
|   24 ++
 1 file changed, 6 insertions(+), 18 deletions(-)

New commits:
commit bfcb1375956877ebd669edf409b71c2a11cc64ce
Author: Tomaž Vajngerl tomaz.vajng...@collabora.co.uk
Date:   Fri Jan 9 20:24:38 2015 +0900

android: reuse rerenderTile in createTile

Change-Id: Ibafdcf5dd54804b4c50dd51d9a5a89dc7088052d

diff --git 
a/android/experimental/LOAndroid3/src/java/org/libreoffice/LOKitTileProvider.java
 
b/android/experimental/LOAndroid3/src/java/org/libreoffice/LOKitTileProvider.java
index d8e11bc..fe389ef 100644
--- 
a/android/experimental/LOAndroid3/src/java/org/libreoffice/LOKitTileProvider.java
+++ 
b/android/experimental/LOAndroid3/src/java/org/libreoffice/LOKitTileProvider.java
@@ -189,25 +189,8 @@ public class LOKitTileProvider implements TileProvider, 
Document.MessageCallback
 @Override
 public CairoImage createTile(float x, float y, IntSize tileSize, float 
zoom) {
 ByteBuffer buffer = ByteBuffer.allocateDirect(tileSize.width * 
tileSize.height * 4);
-
-if (mDocument != null) {
-float twipX = pixelToTwip(x, mDPI) / zoom;
-float twipY = pixelToTwip(y, mDPI) / zoom;
-float twipWidth = mTileWidth / zoom;
-float twipHeight = mTileHeight / zoom;
-long start = System.currentTimeMillis() - objectCreationTime;
-
-//Log.i(LOGTAG, paintTile  @ + start +  ( + tileSize.width + 
  + tileSize.height +   + (int) twipX +   + (int) twipY +   + (int) 
twipWidth +   + (int) twipHeight + ));
-mDocument.paintTile(buffer, tileSize.width, tileSize.height, (int) 
twipX, (int) twipY, (int) twipWidth, (int) twipHeight);
-
-long stop = System.currentTimeMillis() - objectCreationTime;
-//Log.i(LOGTAG, paintTile  @ + stop +  elapsed:  + (stop - 
start));
-} else {
-Log.e(LOGTAG, Document is null!!);
-}
-
 CairoImage image = new BufferedCairoImage(buffer, tileSize.width, 
tileSize.height, CairoImage.FORMAT_ARGB32);
-
+rerenderTile(image, x, y, tileSize, zoom);
 return image;
 }
 
@@ -218,8 +201,13 @@ public class LOKitTileProvider implements TileProvider, 
Document.MessageCallback
 float twipY = pixelToTwip(y, mDPI) / zoom;
 float twipWidth = mTileWidth / zoom;
 float twipHeight = mTileHeight / zoom;
+long start = System.currentTimeMillis() - objectCreationTime;
 
+//Log.i(LOGTAG, paintTile  @ + start +  ( + tileSize.width + 
  + tileSize.height +   + (int) twipX +   + (int) twipY +   + (int) 
twipWidth +   + (int) twipHeight + ));
 mDocument.paintTile(image.getBuffer(), tileSize.width, 
tileSize.height, (int) twipX, (int) twipY, (int) twipWidth, (int) twipHeight);
+
+long stop = System.currentTimeMillis() - objectCreationTime;
+//Log.i(LOGTAG, paintTile  @ + stop +  elapsed:  + (stop - 
start));
 } else {
 if (mDocument == null) {
 Log.e(LOGTAG, Document is null!!);
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits