summaryrefslogtreecommitdiff
path: root/android
diff options
context:
space:
mode:
authorMichael Weghorn <m.weghorn@posteo.de>2022-12-30 08:21:04 +0100
committerMichael Weghorn <m.weghorn@posteo.de>2022-12-30 11:17:40 +0000
commitd993327eab0a2c9c8820c6528075b01de68b0ec6 (patch)
tree6bfb5066880e4ddd544720ff65ff215d4d424974 /android
parent57d79744c77eef96b4c2bd3b16e0a04317ffcf9e (diff)
android: Offer "Save" entry independent of edit actions
Move the "Save" menu entry out of "group_edit_actions", which gets hidden when switching from edit to view mode when the experimental editing feature is enabled in Android Viewer. This e.g. makes sure that the "Save" entry is offered for the following scenario (just as the "Save as" entry is as well): * ensure experimental editing feature is enabled * open existing doc * edit the document * switch back to view mode by tapping the left-most item in the editing toolbar Since the doc was modified, the "Save" entry should be present then. Explicitly hide the entry when the experimental editing feature is disabled, since that no longer happens through "group_edit_actions" now. Change-Id: Ibe7736932021d7516e2fd3a09ae9276015fe0d56 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/144872 Tested-by: Jenkins Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
Diffstat (limited to 'android')
-rw-r--r--android/source/res/menu/main.xml8
-rw-r--r--android/source/src/java/org/libreoffice/ToolbarController.java2
2 files changed, 7 insertions, 3 deletions
diff --git a/android/source/res/menu/main.xml b/android/source/res/menu/main.xml
index 168817f68c5f..b0358a7cc360 100644
--- a/android/source/res/menu/main.xml
+++ b/android/source/res/menu/main.xml
@@ -35,15 +35,17 @@
android:title="@string/action_UNO_commands"
android:orderInCategory="100" />
- <item android:id="@+id/action_save"
- android:title="@string/action_save"
- android:orderInCategory="100" />
</group>
<group android:id="@+id/group_misc_actions"
tools:visible="true"
android:visible="false">
+ <item android:id="@+id/action_save"
+ android:title="@string/action_save"
+ android:orderInCategory="100"
+ android:visible="true" />
+
<item android:id="@+id/action_save_as"
android:title="@string/action_save_as"
android:orderInCategory="100"
diff --git a/android/source/src/java/org/libreoffice/ToolbarController.java b/android/source/src/java/org/libreoffice/ToolbarController.java
index 9f5c5309a523..5d2f9823ad1f 100644
--- a/android/source/src/java/org/libreoffice/ToolbarController.java
+++ b/android/source/src/java/org/libreoffice/ToolbarController.java
@@ -245,6 +245,8 @@ public class ToolbarController implements Toolbar.OnMenuItemClickListener {
// but current document is readonly
Toast.makeText(mContext, mContext.getString(R.string.readonly_file), Toast.LENGTH_LONG).show();
}
+ } else {
+ hideItem(R.id.action_save);
}
mMainMenu.findItem(R.id.action_parts).setVisible(mContext.isDrawerEnabled());
}