The problem was that for large documents if "back" was pressed quickly,
then we closed the document, but rendering thumbnails for the different
parts was still in progress.
Just make sure we don't crash when the underlying document is gone.
E/AndroidRuntime( 8902): java.lang.NullPointerException
E/AndroidRuntime( 8902): at org.libreoffice.LOKitTileProvider.thumbnail(LOKitTileProvider.java:244)
E/AndroidRuntime( 8902): at org.libreoffice.ThumbnailCreator$ThumbnailCreationTask.getThumbnail(ThumbnailCreator.java:78)
E/AndroidRuntime( 8902): at org.libreoffice.LOKitThread.createThumbnail(LOKitThread.java:170)
E/AndroidRuntime( 8902): at org.libreoffice.LOKitThread.processEvent(LOKitThread.java:148)
E/AndroidRuntime( 8902): at org.libreoffice.LOKitThread.run(LOKitThread.java:120)
Change-Id: I93e8e1ea19545ca196ef6f59d19528bb42f3676d
Previously on every rerender or draw event all tiles were
invalidated (which means they were reuploaded to GPU even when
the tiles didn't change). This was changed to only invalidate
tiles that did actually change.
Change-Id: I50a8b51b9d5b44797ac3e2dedd20cfb07fb2bb8b
It can happen that the viewport moves so fast that the tileid is
not valid anymore before it could even be rendered to.
Change-Id: I5ff7d3de6b289ca48ea8a8974705d8306e1be86b
Package name must stay "org.libreoffice" as code gen uses this
for the package name of resources (generated org.libreoffice.R)
which we reference in the source code. Usual practice is to change
the package name at packaging step. The code was changed to allow
this.
Change-Id: I4e36f46c4b8d620f3c9b20fe4fd39737c76624bc
The factory will need access to the Context to be able to transform
the resources into Strings, and the only way to receive it is from
the Activity. Implemented initialize(Context) for that reason.
Change-Id: If6e81a9c4ad73180851e43968ac97aa1e74231e7
We must ensure that two LocalFile objects pointing to the same File
are equal so the check to decide if the application button means "up"
works.
Change-Id: Ib83b34a210eec9a3f038c27d27a4e9b305c98ef9
Implemented a DrawerLayout in the main activity where the providers
are listed. Also added the class DocumentProviderFactory which keeps
the instances of the providers.
Change-Id: I821958e93b9ea1008921db321e825648a8766405
This is the first step towards implementing support for different
cloud providers.
The use of File objects is replaced with the interface IFile, which
has similar operations. A LocalFile implementation is provided to
deal with local contents in the same way it was being done before.
Some system-wide storage operations are abstracted in the interface
IDocumentProvider. A LocalDocumentsProvider implementation is
provided.
Known issues in this patch:
* Dummy filesystem code has been removed. This should be provided as
an implementation of IDocumentProvider in case we need it, but that
will probably not happen.
* Sorting is not implemented in LocalDocumentsProvider yet. It seemed
not to be working anyway.
* Code to get directory thumbnails has been commented out. This code
will probably belong to the IDocumentProvider/IFile implementations.
We might want to have a different approach instead of reading
hidden thumbnail files, something similar to what the native
Start Center does.
Change-Id: Ib0882c69a0b24e28d2346bbe0154db01d1102b06
The call to createUI already performs all the actions done by
openDirectory, there is no need to call it again.
Change-Id: I7f900a23a4f85b627b7132dd6eb54b6e98e7edb6