-/* ownCloud Android client application
+/**
+ * ownCloud Android client application
+ *
+ * @author David A. Velasco
* Copyright (C) 2011 Bartek Przybylski
- * Copyright (C) 2012-2015 ownCloud Inc.
+ * Copyright (C) 2015 ownCloud Inc.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2,
/**
* Activity with common behaviour for activities handling {@link OCFile}s in ownCloud {@link Account}s .
- *
- * @author David A. Velasco
*/
public class FileActivity extends SherlockFragmentActivity
implements OnRemoteOperationListener, ComponentsGetter {
* a new ownCloud {@link Account} finished, successfully or not.
*
* At this moment, only called after the creation of the first account.
- *
- * @author David A. Velasco
*/
public class AccountCreationCallback implements AccountManagerCallback<Bundle> {
if (result.getCode() == ResultCode.UNAUTHORIZED) {
dismissLoadingDialog();
- Toast t = Toast.makeText(this, ErrorMessageAdapter.getErrorCauseMessage(result, operation, getResources()),
+ Toast t = Toast.makeText(this, ErrorMessageAdapter.getErrorCauseMessage(result,
+ operation, getResources()),
Toast.LENGTH_LONG);
t.show();
}
}
- private void onCreateShareOperationFinish(CreateShareOperation operation, RemoteOperationResult result) {
+ private void onCreateShareOperationFinish(CreateShareOperation operation,
+ RemoteOperationResult result) {
dismissLoadingDialog();
if (result.isSuccess()) {
updateFileFromDB();
startActivity(sendIntent);
} else {
- // TODO Detect Failure (403) --> needs Password
+ // Detect Failure (403) --> needs Password
if (result.getCode() == ResultCode.SHARE_FORBIDDEN) {
SharePasswordDialogFragment dialog =
- SharePasswordDialogFragment.newInstance(getFile());
+ SharePasswordDialogFragment.newInstance( new OCFile(operation.getPath()),
+ operation.getSendIntent());
dialog.show(getSupportFragmentManager(), DIALOG_SHARE_PASSWORD);
} else {
- Toast t = Toast.makeText(this, ErrorMessageAdapter.getErrorCauseMessage(result, operation, getResources()),
+ Toast t = Toast.makeText(this,
+ ErrorMessageAdapter.getErrorCauseMessage(result, operation, getResources()),
Toast.LENGTH_LONG);
t.show();
}