From: masensio Date: Mon, 5 Oct 2015 07:43:30 +0000 (+0200) Subject: Add 'Share with users/groups' to long press menu X-Git-Tag: oc-android-1.9^2~30^2~68 X-Git-Url: http://git.linex4red.de/pub/Android/ownCloud.git/commitdiff_plain/3a527a8fe4eaabb59237fc7680fb2f3bf65cc0b0?ds=sidebyside Add 'Share with users/groups' to long press menu --- diff --git a/res/menu/file_actions_menu.xml b/res/menu/file_actions_menu.xml index 63fadbbc..83780bcc 100644 --- a/res/menu/file_actions_menu.xml +++ b/res/menu/file_actions_menu.xml @@ -29,6 +29,14 @@ android:icon="@android:drawable/ic_menu_share" android:orderInCategory="1" /> + + List Layout Share link Unshare link + Share with users + Unshare with users Yes No OK diff --git a/src/com/owncloud/android/files/FileMenuFilter.java b/src/com/owncloud/android/files/FileMenuFilter.java index 738ca7ef..f45d69f6 100644 --- a/src/com/owncloud/android/files/FileMenuFilter.java +++ b/src/com/owncloud/android/files/FileMenuFilter.java @@ -179,7 +179,7 @@ public class FileMenuFilter { toShow.add(R.id.action_sync_file); } - // SHARE FILE + // SHARE FILE // TODO add check on SHARE available on server side? boolean shareAllowed = (mContext != null && mContext.getString(R.string.share_feature).equalsIgnoreCase("on")); @@ -189,7 +189,7 @@ public class FileMenuFilter { toShow.add(R.id.action_share_file); } - // UNSHARE FILE + // UNSHARE FILE // TODO add check on SHARE available on server side? if ( !shareAllowed || (mFile == null || !mFile.isShareByLink())) { toHide.add(R.id.action_unshare_file); @@ -197,6 +197,21 @@ public class FileMenuFilter { toShow.add(R.id.action_unshare_file); } + // SHARE FILE, with Users + if (!shareAllowed || mFile == null) { + toHide.add(R.id.action_share_with_users); + } else { + toShow.add(R.id.action_share_with_users); + } + + // UNSHARE FILE, with Users + // TODO add check on SHARE available on server side? + if ( !shareAllowed || (mFile == null || !mFile.isShareByLink())) { + toHide.add(R.id.action_unshare_with_users); + } else { + toShow.add(R.id.action_unshare_with_users); + } + // SEE DETAILS if (mFile == null || mFile.isFolder()) { toHide.add(R.id.action_see_details);