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:
Álvaro Brey Vilas 2021-12-03 16:17:11 +01:00
parent 038ac7b3c5
commit 7d258f9793
No known key found for this signature in database
GPG key ID: 2585783189A62105

View file

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