From: David A. Velasco Date: Fri, 8 May 2015 12:55:07 +0000 (+0200) Subject: Merge pull request #973 from owncloud/delete_share_option_in_app X-Git-Tag: test~15 X-Git-Url: http://git.linex4red.de/pub/Android/ownCloud.git/commitdiff_plain/47343ca29931255e0e0526dc4f5686a83947b0c5?hp=ea62e966fa12149b43c76115f84e323643a07fc5 Merge pull request #973 from owncloud/delete_share_option_in_app Make share feature configurable --- diff --git a/res/values/setup.xml b/res/values/setup.xml index 524aa2a3..76bdd9f8 100644 --- a/res/values/setup.xml +++ b/res/values/setup.xml @@ -24,6 +24,7 @@ on + on diff --git a/src/com/owncloud/android/files/FileMenuFilter.java b/src/com/owncloud/android/files/FileMenuFilter.java index 04e9fbc1..4b8c55d5 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_feature).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);