[Libreoffice-commits] core.git: android/source

Ximeng Zu uznomis at yahoo.com
Tue Apr 18 12:28:44 UTC 2017


 android/source/src/java/org/libreoffice/LOKitTileProvider.java |    1 +
 android/source/src/java/org/libreoffice/ToolbarController.java |    2 +-
 2 files changed, 2 insertions(+), 1 deletion(-)

New commits:
commit 936ffc11cee7176e63785f3b4a97eb1f0acfdf0e
Author: Ximeng Zu <uznomis at yahoo.com>
Date:   Thu Apr 13 17:32:53 2017 -0500

    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 at libreoffice.org>
    Reviewed-by: Tomaž Vajngerl <quikee at gmail.com>

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);


More information about the Libreoffice-commits mailing list