diff --git a/android/experimental/LOAndroid3/res/values/strings.xml b/android/experimental/LOAndroid3/res/values/strings.xml
index d7a430e5674f..b697c471eb72 100644
--- a/android/experimental/LOAndroid3/res/values/strings.xml
+++ b/android/experimental/LOAndroid3/res/values/strings.xml
@@ -18,6 +18,12 @@
Search
List
Grid
+ Smallest first
+ Largest first
+ A-Z
+ Z-A
+ Oldest first
+ Newest first
Sort By Size
Sort A-Z
Sort by Date
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: