summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSiqi Liu <me@siqi.fr>2015-04-23 15:16:24 +0200
committerJan Holesovsky <kendy@collabora.com>2015-04-24 09:38:46 +0200
commit580ef90e510fd50870c17a225bf5aac1a96f188d (patch)
tree7b43060f2ad8648a22275cb8efe862954b2f9834
parent286132bcbdfe8799c58b28deffe55e8646ecf0e7 (diff)
Set correct title for sort mode after changes.
Change-Id: I4f75f5ee68de6ed6f3b07d93b3681aa2307cb2dc
-rw-r--r--android/experimental/LOAndroid3/res/values/strings.xml6
-rw-r--r--android/experimental/LOAndroid3/src/java/org/libreoffice/ui/LibreOfficeUIActivity.java21
2 files changed, 19 insertions, 8 deletions
diff --git a/android/experimental/LOAndroid3/res/values/strings.xml b/android/experimental/LOAndroid3/res/values/strings.xml
index ffce3d845fdb..66934e077948 100644
--- a/android/experimental/LOAndroid3/res/values/strings.xml
+++ b/android/experimental/LOAndroid3/res/values/strings.xml
@@ -17,6 +17,12 @@
<string name="menu_search">Search</string>
<string name="list_view">List</string>
<string name="grid_view">Grid</string>
+ <string name="sort_smallest">Smallest first</string>
+ <string name="sort_largest">Largest first</string>
+ <string name="sort_az">A-Z</string>
+ <string name="sort_za">Z-A</string>
+ <string name="sort_oldest">Oldest first</string>
+ <string name="sort_newest">Newest first</string>
<string name="menu_sort_size">Sort By Size</string>
<string name="menu_sort_az">Sort A-Z</string>
<string name="menu_sort_modified">Sort by Date</string>
diff --git a/android/experimental/LOAndroid3/src/java/org/libreoffice/ui/LibreOfficeUIActivity.java b/android/experimental/LOAndroid3/src/java/org/libreoffice/ui/LibreOfficeUIActivity.java
index e41846b4b612..79ef341f94a4 100644
--- a/android/experimental/LOAndroid3/src/java/org/libreoffice/ui/LibreOfficeUIActivity.java
+++ b/android/experimental/LOAndroid3/src/java/org/libreoffice/ui/LibreOfficeUIActivity.java
@@ -437,28 +437,33 @@ public class LibreOfficeUIActivity extends ActionBarActivity implements ActionBa
return true;
}
- @SuppressWarnings("unused")//see android:onClick properties in view_menu.xml
public void sortFiles(MenuItem item){
- switch ( item.getItemId() ) {
+ switch (item.getItemId()) {
case R.id.menu_sort_az:
- if( sortMode == FileUtilities.SORT_AZ ){
+ if (sortMode == FileUtilities.SORT_AZ){
sortMode = FileUtilities.SORT_ZA;
- }else{
+ item.setTitle(R.string.sort_az);
+ } else {
sortMode = FileUtilities.SORT_AZ;
+ item.setTitle(R.string.sort_za);
}
break;
case R.id.menu_sort_modified:
- if( sortMode == FileUtilities.SORT_NEWEST ){
+ if (sortMode == FileUtilities.SORT_NEWEST){
sortMode = FileUtilities.SORT_OLDEST;
- }else{
+ item.setTitle(R.string.sort_newest);
+ } else {
sortMode = FileUtilities.SORT_NEWEST;
+ item.setTitle(R.string.sort_oldest);
}
break;
case R.id.menu_sort_size:
- if( sortMode == FileUtilities.SORT_LARGEST ){
+ if (sortMode == FileUtilities.SORT_LARGEST){
sortMode = FileUtilities.SORT_SMALLEST;
- }else{
+ item.setTitle(R.string.sort_largest);
+ } else {
sortMode = FileUtilities.SORT_LARGEST;
+ item.setTitle(R.string.sort_smallest);
}
break;
default: