android/source/res/menu/main.xml | 8 +++++--- android/source/src/java/org/libreoffice/ToolbarController.java | 2 ++ 2 files changed, 7 insertions(+), 3 deletions(-)
New commits: commit d993327eab0a2c9c8820c6528075b01de68b0ec6 Author: Michael Weghorn <m.wegh...@posteo.de> AuthorDate: Fri Dec 30 08:21:04 2022 +0100 Commit: Michael Weghorn <m.wegh...@posteo.de> CommitDate: Fri Dec 30 11:17:40 2022 +0000 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.wegh...@posteo.de> 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()); }