Commit Graph
14 Commits
Author SHA1 Message Date
Michael Weghorn a23bd42e9b android: Drop custom file abstraction + UI
Android Viewer had its own file abstraction layer.

From the (now deleted) IFile.java:

> An abstraction of the File class, intended to be implemented by different
> Document Providers.
>
> It represents a file or a directory in the context of a certain Document
> Provider. It wraps the file-related operations and provides access to the
> final document as a local File, downloading it if necessary.

However, Android already provides such an abstraction by
what is called "documents provider" there as well, s. [1].
Android Viewer has previously been adapted to
support and make use of that.
Therefore, drop the custom implementation to avoid
duplication and having to reimplement functionality
already provided otherwise.

Also, drop the custom UI elements to display and
select files implemented on top of the custom
file abstraction. Support for using the system file
picker (via the corresponding Intents) has been added
earlier and is now the only available option to open
files from within the app.

[1] https://developer.android.com/training/data-storage/shared/documents-files

Change-Id: Ide529e836a32fd7e880e5a72d971af9f9c7e74bf
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/113667
Tested-by: Jenkins
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
2021-04-07 08:29:57 +02:00
Michael Weghorn af56d15d6b android: Move code to get doc's display name from URI to static helper
Will be used in LibreOfficeUIActivity as well.

Change-Id: Ie1b99f0d31dba1be263459d135ee7fcb36613a7b
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/113457
Tested-by: Jenkins
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
2021-04-01 17:18:38 +02:00
Michael Weghorn d678ee309b tdf#129833 android: Allow opening files using system file picker
Extend Android Viewer with the possibility to select a file to
open using the "system file picker", which can be opened by
an Intent that has the action 'Intent.ACTION_OPEN_DOCUMENT'
(or 'Intent.ACTION_GET_CONTENT' for API level < 19) set.

This way, all locations supported by currently installed and
set up DocumentsProviders [1] are generally supported.

In a test, opening local files worked just fine, but trying
to open a file located in a NextCloud share failed
(with the corresponding app [2] installed), showing this
in ADB log:

    I DownloadFileOperation: Download of /Documents/five_pages.odt to /storage/emulated/0/Android/media/com.nextcloud.client/nextcloud/<USERNAME>@demo2.nextcloud.com/Documents/five_pages.odt: Unexpected exception
    E DocumentsStorageProvider: RemoteOperationResult(mSuccess=false, mHttpCode=-1, mHttpPhrase=null, mException=android.os.NetworkOnMainThreadException, mCode=HOST_NOT_AVAILABLE, message=null, getLogMessage=Unexpected exception)

This will be dealt with in a separate commit.

For now, this way to open files (and a corresponding menu
entry) is added in addition to the existing ones, but
since that method should in general be able to cover all of
the other use cases as well, the other options may be
dropped in the future.

[1] https://developer.android.com/reference/android/provider/DocumentsProvider
[2] https://github.com/nextcloud/android

Change-Id: I684a4aa770c0df7cc9fc35ff92445230405885f5
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/112768
Tested-by: Jenkins
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
2021-03-22 07:57:51 +01:00
Mert Tumer fb5b8c524e [Pardus] removed ignore hidden files on Android
ignore hidden files statment is obsolete because
we put option on settings whether they are shown or not
This patch is sponsored by ULAKBIM/Pardus project.
Signed-off-by: Mert Tumer <merttumer@outlook.com>

Change-Id: Ibba7ed76c20a189cff04e330a4493b3e84e5dba2
Reviewed-on: https://gerrit.libreoffice.org/62754
Tested-by: Jenkins
Reviewed-by: Gülşah Köse <gulsah.1004@gmail.com>
2018-11-02 07:01:25 +01:00
Mert Tümer fc5d185bdb tdf#96795: Use locale-sensitive sorting in Android viewer
Change-Id: I98edec9f57f1bf0576e16a1ba3c0e023d6d0b6ed
Signed-off-by: Mert Tümer <merttumer7@gmail.com>
Reviewed-on: https://gerrit.libreoffice.org/52494
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Thorsten Behrens <Thorsten.Behrens@CIB.de>
2018-04-19 01:31:20 +02:00
brainbreaker d70636a314 Discard StorageAccessFramework for creating new documents
This commit adds the ability to create a new document using
existing file system browsing in the app.
Usage of StorageAccessFramework to create new document
has been ditched as it is not backward compatible.

Change-Id: I852c3de337613cb01e689d532476d2c5f932c1b3
Reviewed-on: https://gerrit.libreoffice.org/36195
Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
Tested-by: Tomaž Vajngerl <quikee@gmail.com>
2017-04-18 14:14:14 +02:00
Christian Lohmaier c78de00189 android: simplify some if statements, remove redundant variables
Change-Id: I55a866ac66ffeab5fe2ebb45d86f68558b468650
2017-04-05 21:09:59 +02:00
brainbreaker 1503769fe1 tdf#106325 - No way to create a new Document
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-03-30 19:59:10 +00:00
Caolán McNamara 506432f505 android: don't crash on empty filelist
Change-Id: I46caceed3fdf0ad0aa51c8a8ede1177ca3d1855e
2015-11-17 14:54:32 +00:00
Miklos Vajna 1956b50e3b android: show flat ODS files in the doc browser
I forgot about this when I enabled other Calc file types in
07997cba77 (android: adapt doc browser to
updated manifest that accepts Calc documents, 2015-01-19).

Change-Id: Iabacffbfc09d806f09bc7e0f9307830bda8ebbe1
2015-10-15 08:50:50 +02:00
Christian Lohmaier c320161f48 compare strings using equals, not with ==
Change-Id: I8869980198123bbe9e86e12638e3316be24588c3
2015-10-03 22:54:37 +02:00
Christian Lohmaier 7b282e3db8 android: remove unused imports, call static methods the static way
and remove some redundant casts

Change-Id: If58a395227e4b9d54b0d757032d4a55c25315019
2015-10-03 22:54:37 +02:00
Noel Grandin efd4bfa818 java:regulatize the order of 'final' and public/private
Make the order be 'public static' or 'private static'
Just makes the code nicer to read.

Change-Id: I182424bda45a2d68642e5d04c6091d268ace1fe2
Reviewed-on: https://gerrit.libreoffice.org/16202
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
Tested-by: Noel Grandin <noelgrandin@gmail.com>
2015-06-11 09:34:00 +00:00
Tor Lillqvist ab8cbb6cc1 Let's simplify the paths and be less 'experimental' 2015-05-21 17:10:19 +01:00