Add 'Share with users/groups' to long press menu

This commit is contained in:
masensio 2015-10-05 09:43:30 +02:00 committed by David A. Velasco
parent eaa0612bfa
commit 3a527a8fe4
3 changed files with 27 additions and 2 deletions

View file

@ -28,6 +28,14 @@
android:title="@string/action_unshare_file"
android:icon="@android:drawable/ic_menu_share"
android:orderInCategory="1" />
<item
android:id="@+id/action_share_with_users"
android:title="@string/action_share_with_users"
android:orderInCategory="1" />
<item
android:id="@+id/action_unshare_with_users"
android:title="@string/action_unshare_with_users"
android:orderInCategory="1" />
<item
android:id="@+id/action_open_file_with"
android:title="@string/actionbar_open_with"

View file

@ -87,6 +87,8 @@
<string name="list_layout">List Layout</string>
<string name="action_share_file">Share link</string>
<string name="action_unshare_file">Unshare link</string>
<string name="action_share_with_users">Share with users</string>
<string name="action_unshare_with_users">Unshare with users</string>
<string name="common_yes">Yes</string>
<string name="common_no">No</string>
<string name="common_ok">OK</string>

View file

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