|
@@ -48,7 +48,9 @@ import android.net.Uri;
|
|
|
import android.os.Bundle;
|
|
|
import android.os.Handler;
|
|
|
import android.preference.PreferenceManager;
|
|
|
+import android.text.Editable;
|
|
|
import android.text.InputType;
|
|
|
+import android.text.TextWatcher;
|
|
|
import android.view.KeyEvent;
|
|
|
import android.view.MotionEvent;
|
|
|
import android.view.View;
|
|
@@ -266,6 +268,22 @@ public class AuthenticatorActivity extends AccountAuthenticatorActivity
|
|
|
return true;
|
|
|
}
|
|
|
});
|
|
|
+ mHostUrlInput.addTextChangedListener(new TextWatcher() {
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public void afterTextChanged(Editable s) {
|
|
|
+ if (!mHostBaseUrl.equals(normalizeUrl(mHostUrlInput.getText().toString()))) {
|
|
|
+ mOkButton.setEnabled(false);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public void beforeTextChanged(CharSequence s, int start, int count, int after) {}
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public void onTextChanged(CharSequence s, int start, int before, int count) {}
|
|
|
+
|
|
|
+ });
|
|
|
mPasswordInput.setOnFocusChangeListener(this);
|
|
|
mPasswordInput.setImeOptions(EditorInfo.IME_ACTION_DONE);
|
|
|
mPasswordInput.setOnEditorActionListener(this);
|
|
@@ -409,6 +427,8 @@ public class AuthenticatorActivity extends AccountAuthenticatorActivity
|
|
|
private void onUrlInputFocusLost(TextView hostInput) {
|
|
|
if (!mHostBaseUrl.equals(normalizeUrl(mHostUrlInput.getText().toString()))) {
|
|
|
checkOcServer();
|
|
|
+ } else {
|
|
|
+ mOkButton.setEnabled(mServerIsValid);
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -660,7 +680,7 @@ public class AuthenticatorActivity extends AccountAuthenticatorActivity
|
|
|
url = url.substring(0, url.length() - 1);
|
|
|
}
|
|
|
}
|
|
|
- return url;
|
|
|
+ return (url != null ? url : "");
|
|
|
}
|
|
|
|
|
|
/**
|