mirror of
https://github.com/nextcloud/android.git
synced 2024-11-26 23:28:42 +03:00
No trash button for successful uploads
This commit is contained in:
parent
d098d07889
commit
be00353096
2 changed files with 8 additions and 26 deletions
|
@ -324,29 +324,6 @@ public class OCUpload implements Parcelable {
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns true when user is able to cancel this upload. That is, when
|
||||
* upload is currently in progress or scheduled for upload.
|
||||
*/
|
||||
public boolean userCanCancelUpload() {
|
||||
if (getUploadStatus() == UploadStatus.UPLOAD_IN_PROGRESS) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns true when user can choose to retry this upload. That is, when
|
||||
* upload has failed for any reason.
|
||||
*/
|
||||
public boolean userCanRetryUpload() {
|
||||
if (getUploadStatus() == UploadStatus.UPLOAD_FAILED) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
/****
|
||||
*
|
||||
*/
|
||||
|
|
|
@ -326,7 +326,7 @@ public class ExpandableUploadListAdapter extends BaseExpandableListAdapter imple
|
|||
|
||||
/// bind listeners to perform actions
|
||||
ImageButton rightButton = (ImageButton) view.findViewById(R.id.upload_right_button);
|
||||
if (upload.userCanCancelUpload()) {
|
||||
if (upload.getUploadStatus() == UploadStatus.UPLOAD_IN_PROGRESS) {
|
||||
//Cancel
|
||||
rightButton.setImageResource(R.drawable.ic_cancel);
|
||||
rightButton.setOnClickListener(new OnClickListener() {
|
||||
|
@ -339,7 +339,8 @@ public class ExpandableUploadListAdapter extends BaseExpandableListAdapter imple
|
|||
}
|
||||
}
|
||||
});
|
||||
} else {
|
||||
|
||||
} else if (upload.getUploadStatus() == UploadStatus.UPLOAD_FAILED) {
|
||||
//Delete
|
||||
rightButton.setImageResource(R.drawable.ic_action_delete);
|
||||
rightButton.setOnClickListener(new OnClickListener() {
|
||||
|
@ -349,9 +350,13 @@ public class ExpandableUploadListAdapter extends BaseExpandableListAdapter imple
|
|||
refreshView();
|
||||
}
|
||||
});
|
||||
|
||||
} else { // UploadStatus.UPLOAD_SUCCESS
|
||||
rightButton.setVisibility(View.INVISIBLE);
|
||||
}
|
||||
|
||||
if (upload.userCanRetryUpload()) {
|
||||
// retry
|
||||
if (upload.getUploadStatus() == UploadStatus.UPLOAD_FAILED) {
|
||||
if (UploadResult.CREDENTIAL_ERROR.equals(upload.getLastResult())) {
|
||||
view.setOnClickListener(new OnClickListener() {
|
||||
@Override
|
||||
|
|
Loading…
Reference in a new issue