mirror of
https://github.com/nextcloud/android.git
synced 2024-11-27 09:39:25 +03:00
minor enhancements
Signed-off-by: tobiasKaminsky <tobias@kaminsky.me>
This commit is contained in:
parent
3439981292
commit
940a6b8cb6
4 changed files with 11 additions and 10 deletions
|
@ -483,7 +483,7 @@ public class UploadFilesActivity extends FileActivity implements
|
|||
R.string.upload_query_move_foreign_files, args, 0, R.string.common_yes, -1,
|
||||
R.string.common_no
|
||||
);
|
||||
dialog.setOnConfirmationListener(UploadFilesActivity.this);
|
||||
dialog.setOnConfirmationListener(this);
|
||||
dialog.show(getSupportFragmentManager(), QUERY_TO_MOVE_DIALOG_TAG);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -36,7 +36,7 @@ public class CheckAvailableSpaceTask extends AsyncTask<Boolean, Void, Boolean> {
|
|||
private String[] paths;
|
||||
private CheckAvailableSpaceListener callback;
|
||||
|
||||
public CheckAvailableSpaceTask(CheckAvailableSpaceListener callback, String[] paths) {
|
||||
public CheckAvailableSpaceTask(CheckAvailableSpaceListener callback, String... paths) {
|
||||
this.paths = paths;
|
||||
this.callback = callback;
|
||||
}
|
||||
|
@ -57,10 +57,11 @@ public class CheckAvailableSpaceTask extends AsyncTask<Boolean, Void, Boolean> {
|
|||
*/
|
||||
@Override
|
||||
protected Boolean doInBackground(Boolean... params) {
|
||||
File localFile;
|
||||
long total = 0;
|
||||
for (int i = 0; paths != null && i < paths.length; i++) {
|
||||
String localPath = paths[i];
|
||||
File localFile = new File(localPath);
|
||||
localFile = new File(localPath);
|
||||
total += localFile.length();
|
||||
}
|
||||
return FileStorageUtils.getUsableSpace() >= total;
|
||||
|
|
|
@ -96,6 +96,12 @@ public class ConfirmationDialogFragment extends DialogFragment {
|
|||
throw new IllegalArgumentException("Arguments may not be null");
|
||||
}
|
||||
|
||||
Activity activity = getActivity();
|
||||
|
||||
if (activity == null) {
|
||||
throw new IllegalArgumentException("Activity may not be null");
|
||||
}
|
||||
|
||||
Object[] messageArguments = arguments.getStringArray(ARG_MESSAGE_ARGUMENTS);
|
||||
int messageId = arguments.getInt(ARG_MESSAGE_RESOURCE_ID, -1);
|
||||
int titleId = arguments.getInt(ARG_TITLE_ID, -1);
|
||||
|
@ -107,12 +113,6 @@ public class ConfirmationDialogFragment extends DialogFragment {
|
|||
messageArguments = new String[]{};
|
||||
}
|
||||
|
||||
Activity activity = getActivity();
|
||||
|
||||
if (activity == null) {
|
||||
throw new IllegalArgumentException("Activity may not be null");
|
||||
}
|
||||
|
||||
AlertDialog.Builder builder = new AlertDialog.Builder(activity, R.style.Theme_ownCloud_Dialog)
|
||||
.setIcon(R.drawable.ic_warning)
|
||||
.setIconAttribute(android.R.attr.alertDialogIcon)
|
||||
|
|
|
@ -419,7 +419,7 @@ public class OCFileListFragment extends ExtendedListFragment implements
|
|||
|
||||
@Override
|
||||
public void directCameraUpload() {
|
||||
FileDisplayActivity fileDisplayActivity = ((FileDisplayActivity) getActivity());
|
||||
FileDisplayActivity fileDisplayActivity = (FileDisplayActivity) getActivity();
|
||||
|
||||
if (fileDisplayActivity != null) {
|
||||
fileDisplayActivity.getFileOperationsHelper()
|
||||
|
|
Loading…
Reference in a new issue