summaryrefslogtreecommitdiff
path: root/android/source/src/java/org/libreoffice/LOKitThread.java
AgeCommit message (Collapse)Author
2020-03-06android: Avoid crash when tapping while document is being loadedMichael Weghorn
'mViewportMetrics' can be null here, e.g. while the document is still being loaded. This fixes a crash that happened e.g. when tapping on the screen while document was still being loaded. Change-Id: Ib3f237ecf64c05a5736d97e00b46d0de2ef051a0 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/90048 Tested-by: Jenkins Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
2019-12-04android: Allow zooming for Calc as wellMichael Weghorn
The comment mentioning "Calc has a fixed zoom at 1x and doesn't allow zooming for now" was there since support for the Calc UI was added in commit 02f3c4848ab52358bfee56c570a19a3a071574f2 ("Calc UI on Android Viewer") in 2017. That seems no longer to be the case however, probably since commit 498dceb43f870bf9e380f1f87e99c6ccadf1963c ("sc lok: Implement hi-dpi and zoom for spreadsheets."). Zooming in and out was working just fine when I tested this with Android Viewer using a spreadsheet containing some text and numbers, as well as a chart and an image. Therefore, allow zooming for Calc as well. Don't allow to set min zoom below the page width for Calc as somewhat suggested by the existing comment ("applies to all types of document; in the future spreadsheets may be singled out"). I don't see a particular reason for this and using 0f for minZoom would break double-tap zoom. Change-Id: Ib08439edbbac59a00005213b533df5792da965ee Reviewed-on: https://gerrit.libreoffice.org/84421 Tested-by: Jenkins Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
2018-08-07tdf#119082 Exception wrong thread on Android ViewerMert Tumer
Change-Id: I58a8d104b24c7cf2d021e2dce700e25592c8a605 Signed-off-by: Mert Tumer <merttumer@outlook.com> Reviewed-on: https://gerrit.libreoffice.org/58563 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2018-05-16android janitor... convert chained ifs to switch statementChristian Lohmaier
Change-Id: I9929bd077a33349a6e57c3a427df7e77b3007c88
2018-03-27.uno:Save callback for the Android ViewerMert Tümer
Change-Id: Ic2e16985e52869092faa2a31a59a85cb77b8e28c Signed-off-by: Mert Tümer <merttumer7@gmail.com> Reviewed-on: https://gerrit.libreoffice.org/51506 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Thorsten Behrens <Thorsten.Behrens@CIB.de>
2018-03-14[Pardus] tdf#107026 render the new page without reopen the documentMert Tümer
This patch is sponsored by ULAKBIM/Pardus project. Signed-off-by: Mert Tümer <merttumer7@gmail.com> Change-Id: I91c902bfd1acc5cc70ad30f16e0719e7a325702b Reviewed-on: https://gerrit.libreoffice.org/47636 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Thorsten Behrens <Thorsten.Behrens@CIB.de>
2018-01-18tdf#112140 fix some NPEs re touch/zoom while doucment is not readyChristian Lohmaier
touching the screen or trying to zoom were trying to get/adjust zoom factor despite not ready yet, similarily swiping from the left to show the parts view would crash as well in case the document is not ready yet. Most likely to see this with a debug build (where loading is slower to begin with), or with long documents like the license text. Change-Id: Iea5e8c07a9b0973ce50f90114eb015e8e896e390 Reviewed-on: https://gerrit.libreoffice.org/46848 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Christian Lohmaier <lohmaier+LibreOffice@googlemail.com>
2017-11-16tdf#106370 Android: add ability to insert picturesXimeng Zu
Added ability to insert pictures to Android Viewer. You can take photo or select photo from device or the cloud (Google photos, Dropbox). You can also compress the picture before inserting it with multiple compress grades. So far, inserting doesn't work for Writer due LO native library issues (I think). Change-Id: If6841ba04fe18585703c8b85909cf39747dbbc2f Reviewed-on: https://gerrit.libreoffice.org/41150 Reviewed-by: Tomaž Vajngerl <quikee@gmail.com> Tested-by: Tomaž Vajngerl <quikee@gmail.com>
2017-08-27[Android Viewer] Password supportXimeng Zu
Added password support for documents. Change-Id: Ifd9cf86894ddaf2fd5ad97510d2ac1b5850611ad Reviewed-on: https://gerrit.libreoffice.org/40458 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Tomaž Vajngerl <quikee@gmail.com> Tested-by: Tomaž Vajngerl <quikee@gmail.com>
2017-07-31[Android Viewer] Add cell selection by row/column/allXimeng Zu
Added cell selection to Calc docs in Android Viewer with a similar behavior to LOOL wrt. row/column selection. The user can tap on any header to select whole row/column or select all by tapping the top left corner of the header. Change-Id: I34bdbb1aacc5fc0ed9175908936a8a5e6eec4ff4 Reviewed-on: https://gerrit.libreoffice.org/39694 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2017-07-23Calc UI on Android ViewerXimeng Zu
Adding Calc UI. Two blank views are added as row and column headers. CommonCanvasElement is used to draw header cells on the views. [WIP] Change-Id: I37eaa82805045ab650fd127e54c8421c61a4ea27 Reviewed-on: https://gerrit.libreoffice.org/38936 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Tomaž Vajngerl <quikee@gmail.com> Tested-by: Tomaž Vajngerl <quikee@gmail.com>
2017-05-27Update zoom constraints with device rotateXimeng Zu
Added function of updating zoom constraints whenever device rotates. This is achieved by calculating min zoom factor every time the size change function is called. Change-Id: I6d795c1eb79faa36b4f5dabedd2d4b8c87dcf7d7 Reviewed-on: https://gerrit.libreoffice.org/37847 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2017-04-18tdf#96764 - Android Viewer does not show page countXimeng Zu
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>
2017-04-18tdf#106368 android: restrict zoom to page widthXimeng Zu
Created an overloaded constructor for ZoomConstraints class that takes in minZoom and maxZoom. Added calculation of minZoom according to page width and screen width and assigned the minZoom to ZoomConstraints in LOKitThread class. Deleted minZoom checking in the onScale method in JavaPanZoomController class because the checking prevented zoom-in from functioning. (Update: I also removed the old constructor because it is not used any more.) Change-Id: I89e80761efc093b3738970d4482dd735532c0397 Reviewed-on: https://gerrit.libreoffice.org/35308 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2017-03-30tdf#106325 - No way to create a new Documentbrainbreaker
This commit will add the ability to create a new document. A FAB is used in home screen which on expansion gives four options namely new writer document, new impress, new Sheet or new Draw. Two new events loadNewDocument and saveDocumentAs have been added. Another major change includes the use of constraint layout in LOUIActivity layout as it decreases nesting of views and improves the app performance. This was needed because of the new FAB layouts being added. Support for vector drawables has been enabled. Change-Id: Ia3ea17f73c0d8514f8ddb7b9a1cbd2ce7de6ac08 Reviewed-on: https://gerrit.libreoffice.org/35183 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2017-01-31Removed static context from LOKitThreadaleksandar-stefanovic
Moved LOKitThread back to LibreOfficeMainActivity, so that it could use the context in the constructor. Once the Context became available in LOKitThread, it was simply a matter of replacing static references with the one passed in the constructor. Also changed access levels of some methods in LOKitThread. Change-Id: I0cc2c846c67b90907cbf3dce363666f9ab02d887 Reviewed-on: https://gerrit.libreoffice.org/33546 Reviewed-by: Christian Lohmaier <lohmaier+LibreOffice@googlemail.com> Tested-by: Christian Lohmaier <lohmaier+LibreOffice@googlemail.com>
2017-01-25Reduce usage of memory-leaking Context objectaleksandar-stefanovic
Huge refactoring of the methods to use the passed instance of the Context object instead of using the static one. I couldn't completely remove the static object, because it requires restructuring of the workflow so that it originates from the activity, and not from some other random place. The way it was refactored is: 1. Find a place where the static object (LibreOfficeMainActivity.mAppContext) is used. 2. Add a LibreOfficeMainActivity object to the method signature. 3. Repeat the process with a method that calls it, and repeat until the LibreOfficeMainActivity object isn't available, so that it can be passed through all the methods, to the place where the static object was used. 4. Replace that static object with the parameter of the function. The commit looks pretty huge, but it's basically just the simple refactoring explained above. The memory leak isn't completely gone, but this a progress towards it. Also moved the "global" objects of Handler and LOKitThread from an Activity to an Application, which is the correct place for "global" variables. Can someone explain why Handler and LOKitThread are used? They seem to mostly do nothing, but steeply increasing the complexity of the application. Change-Id: Ib2be77fa3adea94d6b7849d0e2afa90bf318d68b Reviewed-on: https://gerrit.libreoffice.org/33073 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Aleksandar Stefanović <theonewithideas@gmail.com>
2017-01-13tdf#101689 - Fix returning to first part of documents when resumedMert Tumer
Change-Id: I6d3a9354c702628e991c69176086efbbc28ddd74 Reviewed-on: https://gerrit.libreoffice.org/31753 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: jan iversen <jani@documentfoundation.org>
2016-01-10Fix typosAndrea Gelmini
Change-Id: I9a5940027423ff0791fa7da0b79b617412ce6b86 Reviewed-on: https://gerrit.libreoffice.org/21209 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
2015-11-13LOK: setClientZoom() - sets the client zoom levelMihai Varga
We need to know the client's view level to correctly handle the mouse events in calc. PaintTile() set a zoom level that corresponds to the requested tiles and previously postMouseEvent would call SetZoom(1,1). Now we can make use of knowing the client's view level and call SetZoom() with the correct parameters Change-Id: I34b5afcdcc06a671a8ac92c03e87404e42adf4cd Conflicts: sc/source/ui/unoobj/docuno.cxx
2015-11-01android: update JNI facade, rename mouse/keyboard event flagsTomaž Vajngerl
Change-Id: Ia2b9a812717d05c7d98d47bf0fe5fd293029d045
2015-10-03android: remove unused imports, call static methods the static wayChristian Lohmaier
and remove some redundant casts Change-Id: If58a395227e4b9d54b0d757032d4a55c25315019
2015-09-30Fix typosAndrea Gelmini
Change-Id: Ie0e941d48457d758525353d6c5cf858652f86fd3 Reviewed-on: https://gerrit.libreoffice.org/18938 Reviewed-by: Samuel Mehrbrodt <Samuel.Mehrbrodt@cib.de> Tested-by: Samuel Mehrbrodt <Samuel.Mehrbrodt@cib.de>
2015-05-21Let's simplify the paths and be less 'experimental'Tor Lillqvist