android:layout_weight="1"
android:ems="10"
android:hint="@string/auth_host_url"
- android:singleLine="true"
android:inputType="textNoSuggestions">
<requestFocus />
</EditText>
android:layout_weight="1"
android:ems="10"
android:hint="@string/auth_username"
- android:singleLine="true"
android:inputType="textNoSuggestions" />
<FrameLayout
android:layout_weight="1"
android:ems="10"
android:hint="@string/auth_password"
- android:inputType="textPassword"
- android:singleLine="true" />
+ android:inputType="textPassword"/>
<ImageView
android:id="@+id/viewPassword"
android:layout_weight="1"
android:ems="10"
android:hint="@string/auth_host_url"
- android:singleLine="true"
android:inputType="textNoSuggestions" >
<requestFocus />
</EditText>
android:layout_height="0dp"
android:layout_weight="1"
android:ems="10"
- android:singleLine="true"
android:hint="@string/auth_username"
android:inputType="textNoSuggestions" />
android:layout_weight="1"
android:ems="10"
android:hint="@string/auth_password"
- android:inputType="textPassword"
- android:singleLine="true" />
+ android:inputType="textPassword"/>
<ImageView
android:id="@+id/viewPassword"
<string name="auth_wrong_connection_title">Couldn\'t establish connection</string>
<string name="auth_secure_connection">Secure connection established</string>
<string name="auth_login_details">Login details</string>
+ <string name="auth_unauthorized">Invalid login / password</string>
+ <string name="auth_not_found">Wrong path given</string>
+ <string name="auth_internal">Internal server error, code %1$d</string>
<string name="crashlog_message">Application terminated unexpectedly. Would you like to submit crash report?</string>
<string name="crashlog_send_report">Send report</string>
import org.apache.commons.httpclient.HttpStatus;
+import com.owncloud.android.R;
import com.owncloud.android.network.OwnCloudClientUtils;
import eu.alefzero.webdav.WebdavClient;
postResult(true, uri.toString());
break;
case HttpStatus.SC_UNAUTHORIZED:
- postResult(false, "Invalid login or/and password");
+ postResult(false, mContext.getString(R.string.auth_unauthorized));
break;
case HttpStatus.SC_NOT_FOUND:
- postResult(false, "Wrong path given");
+ postResult(false, mContext.getString(R.string.auth_not_found));
break;
default:
- postResult(false, "Internal server error, code: " + login_result);
+ postResult(false, String.format(mContext.getString(R.string.auth_internal), login_result));
}
}
// NOTHING TO DO ; can't find out what situation that leads to the exception in this code, but user logs signal that it happens\r
}\r
TextView tv = (TextView) findViewById(R.id.account_username);\r
- tv.setError(message);\r
+ tv.setError(message + " "); // the extra spaces are a workaround for an ugly bug: \r
+ // 1. insert wrong credentials and connect\r
+ // 2. put the focus on the user name field with using hardware controls (don't touch the screen); the error is shown UNDER the field\r
+ // 3. touch the user name field; the software keyboard appears; the error popup is moved OVER the field and SHRINKED in width, losing the last word\r
+ // Seen, at least, in Android 2.x devices\r
}\r
}\r
public void onCancelClick(View view) {\r