diff options
author | Ximeng Zu <uznomis@yahoo.com> | 2017-04-05 23:37:12 -0500 |
---|---|---|
committer | Tomaž Vajngerl <quikee@gmail.com> | 2017-04-18 14:10:33 +0200 |
commit | 78bc5053a15ef218cce394b0d0e012f1700f760a (patch) | |
tree | ba0047750f6f12ae8f6fb425e2b25f3ee5b4320a /android/source/src/java/org/libreoffice/overlay/DocumentOverlay.java | |
parent | 5333f93a6fd191e424327afe3935f2770a71f620 (diff) |
tdf#96764 - Android Viewer does not show page count
Added page number display in text documents. The page
nunmber calculation in handled on Java side and the
work only involves calls to LOKit when necessary.
Majority of the work is done in DocumentOverlayView.
java, including calculation and displaying. The page
number information is updated whenever a page number
change callback is caught (from LOkit).
Change-Id: I52014806cd647fa805b329825ac29b0e337c11a1
Reviewed-on: https://gerrit.libreoffice.org/36178
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
Diffstat (limited to 'android/source/src/java/org/libreoffice/overlay/DocumentOverlay.java')
-rw-r--r-- | android/source/src/java/org/libreoffice/overlay/DocumentOverlay.java | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/android/source/src/java/org/libreoffice/overlay/DocumentOverlay.java b/android/source/src/java/org/libreoffice/overlay/DocumentOverlay.java index 8d90ef09fa4a..d9d2b372b714 100644 --- a/android/source/src/java/org/libreoffice/overlay/DocumentOverlay.java +++ b/android/source/src/java/org/libreoffice/overlay/DocumentOverlay.java @@ -32,6 +32,8 @@ public class DocumentOverlay { private final DocumentOverlayView mDocumentOverlayView; private final DocumentOverlayLayer mDocumentOverlayLayer; + private final long hidePageNumberRectDelayInMilliseconds = 500; + /** * DocumentOverlayLayer responsibility is to get the changes to the viewport * and report them to DocumentOverlayView. @@ -74,6 +76,10 @@ public class DocumentOverlay { mDocumentOverlayView.initialize(layerView); } + public void setPartPageRectangles(List<RectF> rectangles) { + mDocumentOverlayView.setPartPageRectangles(rectangles); + } + /** * Show the cursor at the defined cursor position on the overlay. */ @@ -97,6 +103,28 @@ public class DocumentOverlay { } /** + * Show the page number rectangle on the overlay. + */ + public void showPageNumberRect() { + LOKitShell.getMainHandler().post(new Runnable() { + public void run() { + mDocumentOverlayView.showPageNumberRect(); + } + }); + } + + /** + * Hide the page number rectangle on the overlay. + */ + public void hidePageNumberRect() { + LOKitShell.getMainHandler().postDelayed(new Runnable() { + public void run() { + mDocumentOverlayView.hidePageNumberRect(); + } + }, hidePageNumberRectDelayInMilliseconds); + } + + /** * Position the cursor to the input position on the overlay. */ public void positionCursor(final RectF position) { |