Simplify code

Signed-off-by: alperozturk <alper_ozturk@proton.me>
This commit is contained in:
alperozturk 2023-12-07 14:30:06 +01:00
parent 534f9c143a
commit 6b3eb3e897
No known key found for this signature in database
GPG key ID: 4E577DC593B59BDF

View file

@ -62,7 +62,6 @@ import com.owncloud.android.ui.dialog.TwoActionDialogFragment;
import com.owncloud.android.utils.FilesSyncHelper;
import com.owncloud.android.utils.theme.ViewThemeUtils;
import java.util.ArrayList;
import java.util.Collections;
import javax.inject.Inject;
@ -173,21 +172,22 @@ public class UploadListActivity extends FileActivity {
R.string.uploader_handle_not_existed_file_dialog_negative_button_text,
R.string.uploader_handle_not_existed_file_dialog_positive_button_text,
new TwoActionDialogFragment.TwoActionDialogActionListener() {
final OCUpload upload = uploadListAdapter.selectedOCUpload;
@Override
public void positiveAction() {
OCUpload upload = uploadListAdapter.selectedOCUpload;
upload.setLastResult(null);
FileUploader.retryUpload(MainApp.getAppContext(), userAccountManager.getUser(), upload);
}
@Override
public void negativeAction() {
OCUpload upload = uploadListAdapter.selectedOCUpload;
OCFile fileOnlyExistOnLocalStorage = getStorageManager().getFileByEncryptedRemotePath(upload.getRemotePath());
getFileOperationsHelper().removeFiles(Collections.singletonList(fileOnlyExistOnLocalStorage), false, false);
uploadListAdapter.removeUpload(upload);
}
});
dialog.show(this.getSupportFragmentManager(), null);
}