X-Git-Url: http://git.linex4red.de/pub/Android/ownCloud.git/blobdiff_plain/9e55ef9585ff99b8317acaa4df0bf6c1c6f4a874..6f1fe5ad6d8b6f49275a8e44c9631cc65b1bafc8:/src/com/owncloud/android/ui/activity/FileActivity.java diff --git a/src/com/owncloud/android/ui/activity/FileActivity.java b/src/com/owncloud/android/ui/activity/FileActivity.java index 34ce5831..8eb20e4d 100644 --- a/src/com/owncloud/android/ui/activity/FileActivity.java +++ b/src/com/owncloud/android/ui/activity/FileActivity.java @@ -1,6 +1,9 @@ -/* 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, @@ -66,8 +69,6 @@ import com.owncloud.android.utils.ErrorMessageAdapter; /** * 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 { @@ -363,8 +364,6 @@ public class FileActivity extends SherlockFragmentActivity * 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 { @@ -454,7 +453,8 @@ public class FileActivity extends SherlockFragmentActivity 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(); } @@ -482,7 +482,8 @@ public class FileActivity extends SherlockFragmentActivity } - private void onCreateShareOperationFinish(CreateShareOperation operation, RemoteOperationResult result) { + private void onCreateShareOperationFinish(CreateShareOperation operation, + RemoteOperationResult result) { dismissLoadingDialog(); if (result.isSuccess()) { updateFileFromDB(); @@ -491,13 +492,15 @@ public class FileActivity extends SherlockFragmentActivity 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(); }