Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix unknown error #1395

Closed
wants to merge 5 commits into from
Closed
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions res/layout/account_setup.xml
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,8 @@
android:paddingRight="55dp"
android:textColorHint="@color/login_text_hint_color"
android:contentDescription="@string/auth_host_address"
>
android:autoLink="web"
android:clickable="true">
<requestFocus />
</EditText>
<ImageButton
Expand Down Expand Up @@ -115,7 +116,9 @@
android:textColorHint="@color/login_text_hint_color"
android:text="@string/auth_testing_connection"
android:minHeight="32dp"
android:contentDescription="@string/auth_testing_connection"/>
android:contentDescription="@string/auth_testing_connection"
android:autoLink="web"
/>

<CheckBox
android:id="@+id/oauth_onOff_check"
Expand Down
2 changes: 1 addition & 1 deletion res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@
<string name="auth_not_configured_title">Malformed server configuration</string>
<string name="auth_account_not_new">An account for the same user and server already exists in the device</string>
<string name="auth_account_not_the_same">The entered user does not match the user of this account</string>
<string name="auth_unknown_error_title">Unknown error occurred!</string>
<string name="auth_unknown_error_title">Unknown error occurred! Please visit </string>
<string name="auth_unknown_host_title">Couldn\'t find host</string>
<string name="auth_incorrect_path_title">Server instance not found</string>
<string name="auth_timeout_title">The server took too long to respond</string>
Expand Down
13 changes: 10 additions & 3 deletions src/com/owncloud/android/authentication/AuthenticatorActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,10 @@
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentTransaction;
import android.text.Editable;
import android.text.Html;
import android.text.InputType;
import android.text.TextWatcher;
import android.text.util.Linkify;
import android.view.KeyEvent;
import android.view.MotionEvent;
import android.view.View;
Expand Down Expand Up @@ -1234,7 +1236,7 @@ private void updateServerStatusIconAndText(RemoteOperationResult result) {
break;
case UNHANDLED_HTTP_CODE:
case UNKNOWN_ERROR:
mServerStatusText = R.string.auth_unknown_error_title;
setStatusUrl();
break;
case OK_REDIRECT_TO_NON_SECURE_CONNECTION:
mServerStatusIcon = R.drawable.ic_lock_open;
Expand Down Expand Up @@ -1321,7 +1323,7 @@ private void updateAuthStatusIconAndText(RemoteOperationResult result) {
break;
case UNHANDLED_HTTP_CODE:
case UNKNOWN_ERROR:
mAuthStatusText = R.string.auth_unknown_error_title;
setStatusUrl();
break;
default:
mAuthStatusText = 0;
Expand Down Expand Up @@ -1605,13 +1607,18 @@ private void showServerStatus() {
mServerStatusView.setVisibility(View.INVISIBLE);

} else {
mServerStatusView.setText(mServerStatusText);
setStatusUrl();
mServerStatusView.setCompoundDrawablesWithIntrinsicBounds(mServerStatusIcon, 0, 0, 0);
mServerStatusView.setVisibility(View.VISIBLE);
}

}

private void setStatusUrl(){
String text = getString(R.string.auth_unknown_error_title) + "<br/>" + mHostUrlInput.getText().toString().trim() + "/status.php";
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think that you should use formatted string:

String text = getString(R.string.auth_unknown_error_title, mHostUrlInput.getText().toString().trim() + "/status.php");

and change auth_unknown_error_title string accordingly

mServerStatusView.setText(Html.fromHtml(text));
Linkify.addLinks(mServerStatusView, Linkify.WEB_URLS);
}

/**
* Updates the content and visibility state of the icon and text associated
Expand Down