Skip to content

Commit dbf8777

Browse files
davcresabelgardep
authored andcommitted
refactor code send files
1 parent 3609231 commit dbf8777

1 file changed

Lines changed: 10 additions & 4 deletions

File tree

owncloudApp/src/main/java/com/owncloud/android/ui/fragment/OCFileListFragment.java

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -938,6 +938,15 @@ private boolean onFileActionChosen(int menuId) {
938938
mContainerActivity.showDetails(singleFile);
939939
return true;
940940
}
941+
case R.id.action_send_file: {
942+
// Obtain the file
943+
if (!singleFile.isDown()) { // Download the file
944+
((FileDisplayActivity) mContainerActivity).startDownloadForSending(singleFile);
945+
} else {
946+
mContainerActivity.getFileOperationsHelper().sendDownloadedFile(singleFile);
947+
}
948+
return true;
949+
}
941950
}
942951
}
943952

@@ -958,10 +967,7 @@ private boolean onFileActionChosen(int menuId) {
958967
return true;
959968
}
960969
case R.id.action_send_file: {
961-
// Obtain the file
962-
if (!filesAreDown(checkedFiles)) { // Download the file
963-
((FileDisplayActivity) mContainerActivity).startDownloadForSending(checkedFiles.get(0));
964-
} else {
970+
if (checkedFiles.size() > 1 && filesAreDown(checkedFiles)) {
965971
mContainerActivity.getFileOperationsHelper().sendDownloadedFiles(checkedFiles);
966972
}
967973
return true;

0 commit comments

Comments
 (0)