diff options
author | Tomaž Vajngerl <tomaz.vajngerl@collabora.co.uk> | 2015-03-31 18:25:51 +0900 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.co.uk> | 2015-04-07 09:18:05 +0200 |
commit | 6d50c72cba304bc4e31aaaa97f16b356a83f76e5 (patch) | |
tree | d0dd6f9bc291acaf0053aef6b72968dce6c63fc2 /android | |
parent | 626e1a2d6d3c3ca1e50515fa591e1888f1beb67c (diff) |
android: single press on a selected shape triggers text edit
Change-Id: If095bbaf5e4a0efec19f0170fd7c912c66b93669
Diffstat (limited to 'android')
-rw-r--r-- | android/experimental/LOAndroid3/src/java/org/libreoffice/canvas/GraphicSelection.java | 14 |
1 files changed, 13 insertions, 1 deletions
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 fbccf1d8c30a..2ba05f33416d 100644 --- a/android/experimental/LOAndroid3/src/java/org/libreoffice/canvas/GraphicSelection.java +++ b/android/experimental/LOAndroid3/src/java/org/libreoffice/canvas/GraphicSelection.java @@ -34,6 +34,7 @@ public class GraphicSelection implements CanvasElement { private GraphicSelectionHandle mHandles[] = new GraphicSelectionHandle[8]; private GraphicSelectionHandle mDragHandle = null; + private boolean mTriggerSinglePress = false; /** * Construct the graphic selection. @@ -131,8 +132,8 @@ public class GraphicSelection implements CanvasElement { mType = DragType.MOVE; sendGraphicSelectionStart(position); } - mStartDragPosition = position; + mTriggerSinglePress = true; } /** @@ -149,6 +150,7 @@ public class GraphicSelection implements CanvasElement { } else if (mType == DragType.EXTEND) { adaptDrawRectangle(position.x, position.y); } + mTriggerSinglePress = false; } /** @@ -172,6 +174,11 @@ public class GraphicSelection implements CanvasElement { sendGraphicSelectionEnd(point); + if (mTriggerSinglePress && mDragHandle == null) { + onSinglePress(point); + mTriggerSinglePress = false; + } + mDrawRectangle = mScaledRectangle; mType = DragType.NONE; } @@ -245,6 +252,11 @@ public class GraphicSelection implements CanvasElement { } } + private void onSinglePress(PointF screenPosition) { + sendGraphicSelection("LongPress", screenPosition); + } + + /** * Reset the selection. */ |