From 62cad676e9beb9d94e8adee6033d7c11c35baf0c Mon Sep 17 00:00:00 2001 From: aleksandar-stefanovic Date: Tue, 31 Jan 2017 17:18:57 +0100 Subject: Add recents files to the document browser The recents mechanism works like this: Every time the file is opened, it saves that file to the shared preferences set, by putting it in the first place, and removing the oldest file from the list, if there are more than 4 recent files. It also adds dynamic App Shortcuts if the device is 7.0 and above. Screenshot: http://imgur.com/a/7kWOl Edited the layout to add a new RecyclerView for recent items, as well as the headers for both the recycler view's. Recent files appear only if in home directory, below app bar and above the file browser. This could be subjected to change in the future. Screenshot of the recents section: http://imgur.com/a/qrqZq Change-Id: I5c99aa26351d9ad2313e18b5b696d04a782e6155 Reviewed-on: https://gerrit.libreoffice.org/33759 Reviewed-by: Christian Lohmaier Tested-by: Christian Lohmaier --- .../res/layout/activity_document_browser.xml | 76 +++++++++++++++++----- android/source/res/layout/item_recent_files.xml | 34 ++++++++++ android/source/res/values/strings.xml | 2 + 3 files changed, 96 insertions(+), 16 deletions(-) create mode 100644 android/source/res/layout/item_recent_files.xml (limited to 'android/source/res') diff --git a/android/source/res/layout/activity_document_browser.xml b/android/source/res/layout/activity_document_browser.xml index 2c1874459b19..a444d6f66b49 100644 --- a/android/source/res/layout/activity_document_browser.xml +++ b/android/source/res/layout/activity_document_browser.xml @@ -22,23 +22,67 @@ android:layout_height="match_parent"> - - - - - + android:layout_height="match_parent"> + + + + + + + + + + + + + + + + + + + + diff --git a/android/source/res/layout/item_recent_files.xml b/android/source/res/layout/item_recent_files.xml new file mode 100644 index 000000000000..fa966d8b554c --- /dev/null +++ b/android/source/res/layout/item_recent_files.xml @@ -0,0 +1,34 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/android/source/res/values/strings.xml b/android/source/res/values/strings.xml index 5cf731100dd0..f02b4097723a 100644 --- a/android/source/res/values/strings.xml +++ b/android/source/res/values/strings.xml @@ -31,6 +31,8 @@ Sort by Date Preferences fileicon + Recent files + All files EXPLORER_VIEW_TYPE CURRENT_DIRECTORY -- cgit