From a41c0b39f2f8aa410550065341c6a51f7d1c5899 Mon Sep 17 00:00:00 2001 From: masensio Date: Mon, 4 May 2015 14:29:17 +0200 Subject: [PATCH 1/4] Add option to turn off share in setup.xml --- res/values/setup.xml | 1 + 1 file changed, 1 insertion(+) diff --git a/res/values/setup.xml b/res/values/setup.xml index 524aa2a323..b5cfc95788 100644 --- a/res/values/setup.xml +++ b/res/values/setup.xml @@ -24,6 +24,7 @@ on + on From 05df07a362565f65fa5eaa2cfe73e878c740f74e Mon Sep 17 00:00:00 2001 From: masensio Date: Mon, 4 May 2015 14:54:49 +0200 Subject: [PATCH 2/4] Enable/disable share option in the menu: long press and details menu, using setup option --- src/com/owncloud/android/files/FileMenuFilter.java | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/com/owncloud/android/files/FileMenuFilter.java b/src/com/owncloud/android/files/FileMenuFilter.java index 04e9fbc131..7dcf8ebff0 100644 --- a/src/com/owncloud/android/files/FileMenuFilter.java +++ b/src/com/owncloud/android/files/FileMenuFilter.java @@ -216,7 +216,9 @@ public class FileMenuFilter { // SHARE FILE // TODO add check on SHARE available on server side? - if (mFile == null) { + boolean shareAllowed = (mContext != null && + mContext.getString(R.string.share_link).equalsIgnoreCase("on")); + if (!shareAllowed || mFile == null) { toHide.add(R.id.action_share_file); } else { toShow.add(R.id.action_share_file); @@ -224,13 +226,12 @@ public class FileMenuFilter { // UNSHARE FILE // TODO add check on SHARE available on server side? - if (mFile == null || !mFile.isShareByLink()) { + if ( !shareAllowed || (mFile == null || !mFile.isShareByLink())) { toHide.add(R.id.action_unshare_file); } else { toShow.add(R.id.action_unshare_file); } - - + // SEE DETAILS if (mFile == null || mFile.isFolder()) { toHide.add(R.id.action_see_details); From fb6047a72c55f03216be6de6f9b0b18c13415cfa Mon Sep 17 00:00:00 2001 From: "David A. Velasco" Date: Fri, 8 May 2015 11:17:39 +0200 Subject: [PATCH 3/4] Rename the flag to show my wish that someday the app will allow to share with other users too --- res/values/setup.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/res/values/setup.xml b/res/values/setup.xml index b5cfc95788..76bdd9f87c 100644 --- a/res/values/setup.xml +++ b/res/values/setup.xml @@ -24,7 +24,7 @@ on - on + on From 8d48929f5bf043b6517fa154ec5228194d9a294d Mon Sep 17 00:00:00 2001 From: "David A. Velasco" Date: Fri, 8 May 2015 11:27:20 +0200 Subject: [PATCH 4/4] Fixed build --- src/com/owncloud/android/files/FileMenuFilter.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/com/owncloud/android/files/FileMenuFilter.java b/src/com/owncloud/android/files/FileMenuFilter.java index 7dcf8ebff0..4b8c55d57d 100644 --- a/src/com/owncloud/android/files/FileMenuFilter.java +++ b/src/com/owncloud/android/files/FileMenuFilter.java @@ -217,7 +217,7 @@ public class FileMenuFilter { // SHARE FILE // TODO add check on SHARE available on server side? boolean shareAllowed = (mContext != null && - mContext.getString(R.string.share_link).equalsIgnoreCase("on")); + mContext.getString(R.string.share_feature).equalsIgnoreCase("on")); if (!shareAllowed || mFile == null) { toHide.add(R.id.action_share_file); } else {