summaryrefslogtreecommitdiff
path: root/platform/android/src/com/artifex/mupdfdemo
AgeCommit message (Collapse)Author
2015-09-29Support for proofingfredrossperry
- use core.fileFormat to decide whether a proof file is being viewed, - don't show the proofing button except for PDF files. - in a proofing activity, show the page that was being viewed when the proof was requested. - Add extra two arguments to fz_write_gproof_file in the Android build.
2015-09-29Android: Changes to improve handling out-of-memory errors.fredrossperry
Probably related to bug 695507.
2015-08-21GProof: Fix Android JNI functions for multipage files.Robin Watts
Explicitly pass the page number into separation related functions.
2015-08-17Add JNI interface to MuPDFCore to read/write separations on a page.Robin Watts
Get separation information out to the Java level.
2015-07-20Tweak Android MuPDF build to respect SUPPORT_GPROOF.Robin Watts
MuPDFCore now supports a gprfSupported method that returns true iff we compiled the core with SUPPORT_GPROOF and a libgs.so is available.
2015-07-20Add Proofing button to Android UI.Robin Watts
Hit the proofing button, and we create a new temporary .gproof file. We invoke a new version of MuPDF on that. When that finishes control returns to us, and we delete the .gproof file. Currently the new version of MuPDF loads the .gproof file, but fails to generate any pages from it, as we have no version of ghostscript on the system. Generating this new ghostscript is the next job.
2015-04-14android: Add EPUB support to file chooser. Fix crash on non-pdf documents.Tor Andersson
2015-04-03Bug 693481: Android: Allow panning while zoomingRobin Watts
Adopt (slightly modified) version of Kenny Lam's patch to allow panning while zooming. This more closely matches how a web view behaves.
2015-04-03Bug 694388: Android: Don't call requestLayout more than we need to.Robin Watts
Thanks to Goncalo Ferreira for spotting this.
2015-03-26Android: Tweak MuPDFReaderView enum definition.Robin Watts
Given that MuPDFReaderView has a public setMode call, ensure that the enum with the Mode values in is public too. Thanks to Jeremy Dixon for pointing out the issue.
2015-03-26Bug 695811: Adopt Freds patch for Android crashes with strange filenames.Robin Watts
I can't claim to entirely understand why one formulation works and the other doesn't, but it seems a harmless enough fix that apparently works.
2015-01-22Fix android scrolling bug.Robin Watts
Spotted by "Pogon". The code to choose between horizontal and vertical scrolling was broken due to a missing ! in a condition. Cut and Paste error.
2014-09-18android: Fix crash when external storage is missing.Tor Andersson
2014-09-08Add option for vertical scrolling support in Android App.Robin Watts
A potential customer (currently a free user) contacted us asking that MuPDF be extended to support vertical scrolling rather than horizontal scrolling. He supplied a partially working patch. We reviewed his patch, and found the bit he'd missed, which he added and it now works for his purposes. We also spotted some places where his patch is incorrect in general though (and will go wrong for cases where PDF files have varying page sizes). This is a commit of a correct version. ReaderView gains a HORIZONTAL_SCROLLING boolean that is set to true currently to maintain the normal behaviour. Change it to false and we will scroll vertically instead. Possibly we could add a button to allow this to be a runtime option, but that's a future enhancement.
2014-07-08Fix #693228 - Android has counter intuitive finger dragging behaviourMatt Holgate
Patch from Michaël Cadilhac. Continue to pass events to panning GestureDetector when zooming (but do not act on the reported gesture). Previously we just stopped sending events to the GestureDetector until the start of the next gesture.
2014-07-03Android: Prevent editing of files opened from a memory buffer.Matt Holgate
Memory buffers are used for implementing content:// URLs, which are (in most cases) readonly. If we ever encounter a read/write content:// URL in the future, we could consider supporting saving to it. (An example of a content:// URI is an email attachment, where IPC is used to transfer the file from the email client, rather than relying on a local file).
2014-07-02Pass mimetype when opening a document from a stream.Matt Holgate
Fixes opening non-PDF files from email programs that use a ContentProvider to supply attachments.
2014-07-02Fix opening files from Email app.Matt Holgate
On 2.3.x, opening files from the Android email app (not Gmail), was causing a crash due to a SecurityException. On 4.x, it was failing with an error message. I think we should have just been calling getContentResolver().openInputStream(uri) to get the file data, rather than reading the row from the content resolver and looking at the _data field. On 2.3.x querying this row caused a security error. On 4.x, we got back a _data field containing a path, but this path was internal to the email app, and not for our consumption. Previously we were calling openInputStream() only as a fallback; now we try it first, and fall back to the other method if that fails. I suspect we can delete the other code, but I can't test on the 3.x version of the Transformer Prime, so I'm leaving it be for now.
2014-07-01Bug #694104 - Allow using MuPDFReaderView from GUI layout tool.Matt Holgate
The GUI layout tool instantiates custom controls classes to display a preview in the IDE. It relies on the 2-argument constructor being implemented. Use a different means to get the window manager that works for non-activity contexts, and avoid creating gesture recognizers in this situation. Based on a patch supplied by Masaki Muranaka
2014-06-27Fix #695217 - don't allow annotation of encrypted PDFsMatt Holgate
2014-06-25Fix for pages being repeated when running on Android Honeycomb.Matt Holgate
Fixes bug #695191 - Mupdf Build49/armv7a & Android 3.1: cycles through subset of pages & page scrubber The problem here was that in Honeycomb, various bitmap operations (including drawing via JNI) do not update the bitmap generation count. When hardware acceleration is enabled, this means that the underlying GL layer is not aware that the bitmap has changed, and ends up reusing old textures. To workaround this, we erase the bitmap before drawing the page. Erase appears to be the only operation I could find (after pouring through the source), which actually increments the generation count. The other option would have been to disable hardware acceleration, but that was far less ideal.
2014-06-23Fix crash when dismissing 'Cannot open document' dialog with back button, ↵Matt Holgate
then pressing back button again. I've also added an onCancel() handler, so that the back button only needs to be pressed once to return to the file picker view. Spotted while looking at bug #693719 - Attached PDF file does not display (edit)
2014-06-20Improvement which should hopefully help with bug #693607 - MupdfActivity ↵Matt Holgate
crash when rotating the device. When cancelling a render async task, we now wait for it to actually finish before continuing. The benefit of this is that we should be able to guarantee that its Bitmap becomes eligible for GC before we continue to create any new bitmaps. This should hopefully help with the OOM errors seen when rotating the device and trying to create the new bitmaps. To prevent the UI thread from being blocked for too long while we're waiting for the async task to finish, we use a fz_cookie and set the 'abort' flag to request the render be stopped as soon as possible.
2014-06-18Add annotation to fix building from Eclipse.Matt Holgate
2014-06-18Fix bug #695132: MuPDF Library throwing sporadic exception on AndroidMatt Holgate
Android sometimes calls the 'getSelectedView()' method of an AdapterView. This can be made to happen more predicatably by enabling the Talkback accessibility feature. Remove the UnsupportedOperationException and just return null, as we the ReaderView does not have the concept of a selected page.
2014-04-22Tweak Intent usage for ChoosePDFActivityRobin Watts
ChoosePDFActivity can be used either to select PDF/XPS etc files, or to select key files (for digital signatures). The choice of which one to use is made according to the action string in the Intent with which the activity is invoked. Previously we would look for Intent.action.MAIN and take this to mean "Look for PDF files", and anything else to mean look for key files. Unfortunately, if you start the activity directly using adb then the action string is null, so we look for key files. The fix is to use a specific (custom) string for key files and for everything else to be treated as a request for PDF files.
2014-04-01Solve crash (NullPointerException) when cancelling from password promptRobin Watts
Attempt to open a file that needs a password, and you will get a dialogue box. Hit cancel on this, and the program crashes. This is due to an attempt to release the bitmaps on a document view that does not exist. Simple fix.
2014-04-01Fix Android build w.r.t. mujs.Robin Watts
The get_globals helper function only works on non-class objects. Hence 'MuPDFCore_javascriptSupported' can't be a static function.
2014-01-06Android: for scroll steps, use postOnAnimation when availablePaul Gardiner
Using postOnAnimation in place of post noticably improves scroll smoothness. Also avoid posting multiple runnables unnecessarily.
2014-01-02Bug 694732: Android: draw single point strokes when inkingPaul Gardiner
Make single-point strokes display by special casing them as circles. Thanks for Michael Cadilhac for the suggestion.
2014-01-02Bug 694753: Android: Recompute the patch on PageView.update()Paul Gardiner
In some cases freshly-created annotations could fail to appear because the HQ patch was being left in place even when zoomed fully in, and when in that state, the patch was not updated. The bug was usually hidden by an onLayout call being triggered with an out- of-date patch, which causes the HQ patch to be removed. The bug is fixed by having addHq remove the patch when fully zoomed out. Since now addHq may sometimes add the patch and sometimes remove it, I've renamed it to updateHq. Correctness of this fix has not been checked because I was unable to trigger the bad behaviour on my test device.
2013-12-18Android: a few improvements to the view handlingPaul Gardiner
While scrolling, avoid some overheads to do with image scaling that need updating only on a zoom-level change Remove a pointless invalidate call. Avoid calls to removeViewInLayout and removeAllViewsInLayout that were being made in functions not called from onLayout
2013-12-17Bug 694831: Check width and height of bitmap, not width and widthRobin Watts
Thanks to Dale King for reporting this.
2013-09-25Android: while adjusting reflow zoom, refresh only the visible pagePaul Gardiner
Also fix a race condition where an attempt to set the zoom might precede the loading of html into the WebView
2013-09-16Android: remove use of Bitmap holder and avoid memory churnPaul Gardiner
Now use one-time allocation of page-sized bitmaps
2013-08-27Android: support signingPaul Gardiner
2013-08-27Android: add signature checkingPaul Gardiner
2013-08-21Bug 694522: Cope with selection of text on a JPEG image.Robin Watts
If there is no text to select we return an array with a NULL in it and this causes the code to crash. Simple workaround.
2013-08-14Bug 694516: Fix Android operation with passworded files.Robin Watts
Don't countPages until after we have a password.
2013-06-20Rearrange source files.Tor Andersson