Kaydet (Commit) ed42840d authored tarafından Tomaž Vajngerl's avatar Tomaž Vajngerl Kaydeden (comit) Miklos Vajna

android: support selection change (start,end) to TileProvider

Change-Id: If983699dacbd6c992ffff886215e8f686e0f5a2d
üst bb0892de
...@@ -339,6 +339,20 @@ public class LOKitTileProvider implements TileProvider, Document.MessageCallback ...@@ -339,6 +339,20 @@ public class LOKitTileProvider implements TileProvider, Document.MessageCallback
mouseButton(Document.MOUSE_BUTTON_UP, documentCoordinate, numberOfClicks); mouseButton(Document.MOUSE_BUTTON_UP, documentCoordinate, numberOfClicks);
} }
@Override
public void setTextSelectionStart(PointF documentCoordinate) {
int x = (int) pixelToTwip(documentCoordinate.x, mDPI);
int y = (int) pixelToTwip(documentCoordinate.y, mDPI);
mDocument.setTextSelection(Document.TEXT_SELECTION_START, x, y);
}
@Override
public void setTextSelectionEnd(PointF documentCoordinate) {
int x = (int) pixelToTwip(documentCoordinate.x, mDPI);
int y = (int) pixelToTwip(documentCoordinate.y, mDPI);
mDocument.setTextSelection(Document.TEXT_SELECTION_END, x, y);
}
@Override @Override
protected void finalize() throws Throwable { protected void finalize() throws Throwable {
close(); close();
......
...@@ -104,6 +104,16 @@ public class MockTileProvider implements TileProvider { ...@@ -104,6 +104,16 @@ public class MockTileProvider implements TileProvider {
} }
@Override
public void setTextSelectionStart(PointF documentCoordinate) {
}
@Override
public void setTextSelectionEnd(PointF documentCoordinate) {
}
@Override @Override
public void changePart(int partIndex) { public void changePart(int partIndex) {
} }
......
...@@ -82,4 +82,8 @@ public interface TileProvider { ...@@ -82,4 +82,8 @@ public interface TileProvider {
* @param numberOfClicks - number of clicks (1 - single click, 2 - double click) * @param numberOfClicks - number of clicks (1 - single click, 2 - double click)
*/ */
void mouseButtonUp(PointF documentCoordinate, int numberOfClicks); void mouseButtonUp(PointF documentCoordinate, int numberOfClicks);
void setTextSelectionStart(PointF documentCoordinate);
void setTextSelectionEnd(PointF documentCoordinate);
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment