Age | Commit message (Collapse) | Author |
|
Fixes opening non-PDF files from email programs that use a ContentProvider
to supply attachments.
|
|
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.
|
|
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
|
|
|
|
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.
|
|
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)
|
|
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.
|
|
|
|
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.
|
|
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.
|
|
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.
|
|
The get_globals helper function only works on non-class objects.
Hence 'MuPDFCore_javascriptSupported' can't be a static function.
|
|
Using postOnAnimation in place of post noticably improves scroll
smoothness. Also avoid posting multiple runnables unnecessarily.
|
|
Make single-point strokes display by special casing them as
circles. Thanks for Michael Cadilhac for the suggestion.
|
|
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.
|
|
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
|
|
Thanks to Dale King for reporting this.
|
|
Also fix a race condition where an attempt to set the zoom might precede
the loading of html into the WebView
|
|
Now use one-time allocation of page-sized bitmaps
|
|
|
|
|
|
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.
|
|
Don't countPages until after we have a password.
|
|
|