Fix pull request requested changes

# Conflicts:
#	src/com/owncloud/android/authentication/AuthenticatorActivity.java
#	src/com/owncloud/android/utils/ErrorMessageAdapter.java
This commit is contained in:
davigonz 2016-12-30 13:25:33 +01:00 committed by AndyScherzinger
parent 501181d9a2
commit 72aff4c622
No known key found for this signature in database
GPG key ID: 6CADC7E3523C308B
3 changed files with 15 additions and 52 deletions

View file

@ -1546,9 +1546,9 @@ public class AuthenticatorActivity extends AccountAuthenticatorActivity
}
private void updateStatusIconFailUserName(int statusText){
private void updateFailedAuthStatusIconAndText(int failedStatusText){
mAuthStatusIcon = R.drawable.ic_alert;
mAuthStatusText = statusText;
mAuthStatusText = failedStatusText;
}
private void updateServerStatusIconNoRegularAuth() {

View file

@ -266,18 +266,15 @@ public class UsersAndGroupsSearchProvider extends ContentProvider {
// the thread may die before, an exception will occur, and the message will be left on the screen
// until the app dies
// Edited: this toast message has no sense. If operation is being passed as null to getErrorCauseMessage(),
// the returned message is always null and therefore an empty toast is shown. Pending to review and change/delete
// Toast.makeText(
// getContext().getApplicationContext(),
// ErrorMessageAdapter.getErrorCauseMessage(
// result,
// null,
// getContext().getResources()
// ),
// Toast.LENGTH_SHORT
// ).show();
Toast.makeText(
getContext().getApplicationContext(),
ErrorMessageAdapter.getErrorCauseMessage(
result,
null,
getContext().getResources()
),
Toast.LENGTH_SHORT
).show();
}
});
}

View file

@ -85,9 +85,6 @@ public class ErrorMessageAdapter {
} else if (result.getCode() == ResultCode.INVALID_CHARACTER_DETECT_IN_SERVER) {
message = res.getString(R.string.filename_forbidden_charaters_from_server);
} else if (result.getCode() == ResultCode.MAINTENANCE_MODE) {
message = res.getString(R.string.maintenance_mode);
} else {
message = String.format(
res.getString(R.string.uploader_upload_failed_content_single),
@ -106,9 +103,6 @@ public class ErrorMessageAdapter {
if (result.getCode() == ResultCode.FILE_NOT_FOUND) {
message = res.getString(R.string.downloader_download_file_not_found);
} else if (result.getCode() == ResultCode.MAINTENANCE_MODE) {
message = res.getString(R.string.maintenance_mode);
} else {
message = String.format(
res.getString(R.string.downloader_download_failed_content), new File(
@ -126,9 +120,6 @@ public class ErrorMessageAdapter {
message = String.format(res.getString(R.string.forbidden_permissions),
res.getString(R.string.forbidden_permissions_delete));
} else if (result.getCode() == ResultCode.MAINTENANCE_MODE) {
message = res.getString(R.string.maintenance_mode);
} else {
message = res.getString(R.string.remove_fail_msg);
}
@ -149,9 +140,6 @@ public class ErrorMessageAdapter {
} else if (result.getCode() == ResultCode.INVALID_CHARACTER_DETECT_IN_SERVER) {
message = res.getString(R.string.filename_forbidden_charaters_from_server);
} else if (result.getCode() == ResultCode.MAINTENANCE_MODE) {
message = res.getString(R.string.maintenance_mode);
} else {
message = res.getString(R.string.rename_server_fail_msg);
}
@ -172,9 +160,6 @@ public class ErrorMessageAdapter {
} else if (result.getCode() == ResultCode.INVALID_CHARACTER_DETECT_IN_SERVER) {
message = res.getString(R.string.filename_forbidden_charaters_from_server);
} else if (result.getCode() == ResultCode.MAINTENANCE_MODE) {
message = res.getString(R.string.maintenance_mode);
} else {
message = res.getString(R.string.create_dir_fail_msg);
}
@ -193,9 +178,6 @@ public class ErrorMessageAdapter {
message = String.format(res.getString(R.string.forbidden_permissions),
res.getString(R.string.share_link_forbidden_permissions));
} else if (result.getCode() == ResultCode.MAINTENANCE_MODE) {
message = res.getString(R.string.maintenance_mode);
} else { // Generic error
// Show a Message, operation finished without success
message = res.getString(R.string.share_link_file_error);
@ -214,9 +196,6 @@ public class ErrorMessageAdapter {
message = String.format(res.getString(R.string.forbidden_permissions),
res.getString(R.string.unshare_link_forbidden_permissions));
} else if (result.getCode() == ResultCode.MAINTENANCE_MODE) {
message = res.getString(R.string.maintenance_mode);
} else { // Generic error
// Show a Message, operation finished without success
message = res.getString(R.string.unshare_link_file_error);
@ -236,9 +215,6 @@ public class ErrorMessageAdapter {
message = String.format(res.getString(R.string.forbidden_permissions),
res.getString(R.string.update_link_forbidden_permissions));
} else if (result.getCode() == ResultCode.MAINTENANCE_MODE) {
message = res.getString(R.string.maintenance_mode);
} else { // Generic error
// Show a Message, operation finished without success
message = res.getString(R.string.update_link_file_error);
@ -261,9 +237,6 @@ public class ErrorMessageAdapter {
} else if (result.getCode() == ResultCode.INVALID_CHARACTER_DETECT_IN_SERVER) {
message = res.getString(R.string.filename_forbidden_charaters_from_server);
} else if (result.getCode() == ResultCode.MAINTENANCE_MODE) {
message = res.getString(R.string.maintenance_mode);
} else { // Generic error
// Show a Message, operation finished without success
message = res.getString(R.string.move_file_error);
@ -278,9 +251,6 @@ public class ErrorMessageAdapter {
message = String.format(res.getString(R.string.sync_current_folder_was_removed),
folderPathName);
} else if (result.getCode() == ResultCode.MAINTENANCE_MODE) {
message = res.getString(R.string.maintenance_mode);
} else { // Generic error
// Show a Message, operation finished without success
message = String.format(res.getString(R.string.sync_folder_failed_content),
@ -302,17 +272,10 @@ public class ErrorMessageAdapter {
message = String.format(res.getString(R.string.forbidden_permissions),
res.getString(R.string.forbidden_permissions_copy));
} else if (result.getCode() == ResultCode.MAINTENANCE_MODE) {
message = res.getString(R.string.maintenance_mode);
} else { // Generic error
// Show a Message, operation finished without success
message = res.getString(R.string.copy_file_error);
}
} else if (operation instanceof GetSharesForFileOperation) {
if (result.getCode() == ResultCode.MAINTENANCE_MODE) {
message = res.getString(R.string.maintenance_mode);
}
}
return message;
@ -350,6 +313,9 @@ public class ErrorMessageAdapter {
return code == ResultCode.WRONG_CONNECTION ||
code == ResultCode.TIMEOUT ||
code == ResultCode.HOST_NOT_AVAILABLE ||
code == ResultCode.MAINTENANCE_MODE;
code == ResultCode.MAINTENANCE_MODE) {
return true;
} else
return false;
}
}