diff options
author | Ximeng Zu <uznomis@yahoo.com> | 2017-04-13 17:32:53 -0500 |
---|---|---|
committer | Tomaž Vajngerl <quikee@gmail.com> | 2017-04-18 14:28:17 +0200 |
commit | 936ffc11cee7176e63785f3b4a97eb1f0acfdf0e (patch) | |
tree | 47a8449ca5e7c444d0a8973013482c9258d9ba4d | |
parent | 1a748066b49ceaa8cdd3477556756336d6dfb8b3 (diff) |
tdf#96770 android: disable 'parts' in text documents
Text documents only have one part, so 'parts' button
in the menu should be disabled.
Change-Id: Id36a57bcf35bc6347136dda82d8da2d7ca308285
Reviewed-on: https://gerrit.libreoffice.org/36538
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
-rw-r--r-- | android/source/src/java/org/libreoffice/LOKitTileProvider.java | 1 | ||||
-rw-r--r-- | android/source/src/java/org/libreoffice/ToolbarController.java | 2 |
2 files changed, 2 insertions, 1 deletions
diff --git a/android/source/src/java/org/libreoffice/LOKitTileProvider.java b/android/source/src/java/org/libreoffice/LOKitTileProvider.java index 29def6e97794..e17893985a75 100644 --- a/android/source/src/java/org/libreoffice/LOKitTileProvider.java +++ b/android/source/src/java/org/libreoffice/LOKitTileProvider.java @@ -117,6 +117,7 @@ class LOKitTileProvider implements TileProvider { } } else { mContext.disableNavigationDrawer(); + mContext.getToolbarController().disableMenuItem(R.id.action_parts, true); } mDocument.setPart(0); diff --git a/android/source/src/java/org/libreoffice/ToolbarController.java b/android/source/src/java/org/libreoffice/ToolbarController.java index 0191c924446c..d7f1ac18c95e 100644 --- a/android/source/src/java/org/libreoffice/ToolbarController.java +++ b/android/source/src/java/org/libreoffice/ToolbarController.java @@ -37,7 +37,7 @@ public class ToolbarController implements Toolbar.OnMenuItemClickListener { mMainMenu = mToolbarTop.getMenu(); } - private void disableMenuItem(final int menuItemId, final boolean disabled) { + public void disableMenuItem(final int menuItemId, final boolean disabled) { LOKitShell.getMainHandler().post(new Runnable() { public void run() { MenuItem menuItem = mMainMenu.findItem(menuItemId); |