mirror of
https://github.com/nextcloud/android.git
synced 2024-11-27 17:46:37 +03:00
Enable/disable share option in the menu: long press and details menu, using setup option
This commit is contained in:
parent
a41c0b39f2
commit
05df07a362
1 changed files with 5 additions and 4 deletions
|
@ -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);
|
||||
|
|
Loading…
Reference in a new issue