mirror of
https://github.com/nextcloud/android.git
synced 2024-11-26 15:15:51 +03:00
Use constants
This commit is contained in:
parent
d079808c6d
commit
e73091a212
2 changed files with 6 additions and 5 deletions
|
@ -56,8 +56,8 @@ public class CustomEditText extends android.support.v7.widget.AppCompatEditText
|
|||
}
|
||||
|
||||
public String getFullServerUrl() {
|
||||
if (TextUtils.isEmpty(fixedText) || getText().toString().startsWith("http://")
|
||||
|| getText().toString().startsWith("https://")) {
|
||||
if (TextUtils.isEmpty(fixedText) || getText().toString().startsWith(AuthenticatorActivity.HTTP_PROTOCOL)
|
||||
|| getText().toString().startsWith(AuthenticatorActivity.HTTPS_PROTOCOL)) {
|
||||
return getText().toString();
|
||||
} else if (isPrefixFixed) {
|
||||
return (getResources().getString(R.string.server_url) + "/" + getText().toString());
|
||||
|
@ -77,7 +77,8 @@ public class CustomEditText extends android.support.v7.widget.AppCompatEditText
|
|||
@Override
|
||||
protected void onDraw(Canvas canvas) {
|
||||
super.onDraw(canvas);
|
||||
if (!getText().toString().startsWith("http://") && !getText().toString().startsWith("https://")
|
||||
if (!getText().toString().startsWith(AuthenticatorActivity.HTTP_PROTOCOL)
|
||||
&& !getText().toString().startsWith(AuthenticatorActivity.HTTPS_PROTOCOL)
|
||||
&& !TextUtils.isEmpty(fixedText)) {
|
||||
if (isPrefixFixed) {
|
||||
canvas.drawText(fixedText, super.getCompoundPaddingLeft(), getBaseline(), getPaint());
|
||||
|
|
|
@ -147,8 +147,8 @@ public class AuthenticatorActivity extends AccountAuthenticatorActivity
|
|||
private static final String KEY_ASYNC_TASK_IN_PROGRESS = "AUTH_IN_PROGRESS";
|
||||
public static final String PROTOCOL_SUFFIX = "://";
|
||||
public static final String LOGIN_URL_DATA_KEY_VALUE_SEPARATOR = ":";
|
||||
private static final String HTTPS_PROTOCOL = "https://";
|
||||
private static final String HTTP_PROTOCOL = "http://";
|
||||
public static final String HTTPS_PROTOCOL = "https://";
|
||||
public static final String HTTP_PROTOCOL = "http://";
|
||||
|
||||
public static final String REGULAR_SERVER_INPUT_TYPE = "regular";
|
||||
public static final String SUBDOMAIN_SERVER_INPUT_TYPE = "prefix";
|
||||
|
|
Loading…
Reference in a new issue