mirror of
https://github.com/nextcloud/android.git
synced 2024-11-22 05:05:31 +03:00
FileMenuFilter: Allow "Send" for single files if in file detail fragment
Signed-off-by: Álvaro Brey Vilas <alvaro.brey@nextcloud.com>
This commit is contained in:
parent
038ac7b3c5
commit
7d258f9793
1 changed files with 12 additions and 6 deletions
|
@ -193,7 +193,7 @@ public class FileMenuFilter {
|
|||
filterCancelSync(toShow, toHide, synchronizing);
|
||||
filterSync(toShow, toHide, synchronizing);
|
||||
filterShareFile(toShow, toHide, capability);
|
||||
filterSendFiles(toShow, toHide);
|
||||
filterSendFiles(toShow, toHide, inSingleFileFragment);
|
||||
filterDetails(toShow, toHide);
|
||||
filterFavorite(toShow, toHide, synchronizing);
|
||||
filterUnfavorite(toShow, toHide, synchronizing);
|
||||
|
@ -213,12 +213,18 @@ public class FileMenuFilter {
|
|||
}
|
||||
}
|
||||
|
||||
private void filterSendFiles(List<Integer> toShow, List<Integer> toHide) {
|
||||
if (containsEncryptedFile() || isSingleSelection() || overflowMenu || !anyFileDown() ||
|
||||
SEND_OFF.equalsIgnoreCase(context.getString(R.string.send_files_to_other_apps))) {
|
||||
toHide.add(R.id.action_send_file);
|
||||
} else {
|
||||
private void filterSendFiles(List<Integer> toShow, List<Integer> toHide, boolean inSingleFileFragment) {
|
||||
boolean show = true;
|
||||
if (containsEncryptedFile() || overflowMenu || SEND_OFF.equalsIgnoreCase(context.getString(R.string.send_files_to_other_apps))) {
|
||||
show = false;
|
||||
}
|
||||
if (!inSingleFileFragment && (isSingleSelection() || !anyFileDown())) {
|
||||
show = false;
|
||||
}
|
||||
if (show) {
|
||||
toShow.add(R.id.action_send_file);
|
||||
} else {
|
||||
toHide.add(R.id.action_send_file);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue