import android.os.Bundle;\r
import android.os.Handler;\r
import android.preference.PreferenceManager;\r
+import android.text.Editable;\r
import android.text.InputType;\r
+import android.text.TextWatcher;\r
import android.view.KeyEvent;\r
import android.view.MotionEvent;\r
import android.view.View;\r
return true;\r
}\r
});\r
+ mHostUrlInput.addTextChangedListener(new TextWatcher() {\r
+\r
+ @Override\r
+ public void afterTextChanged(Editable s) {\r
+ if (!mHostBaseUrl.equals(normalizeUrl(mHostUrlInput.getText().toString()))) {\r
+ mOkButton.setEnabled(false);\r
+ }\r
+ }\r
+\r
+ @Override\r
+ public void beforeTextChanged(CharSequence s, int start, int count, int after) {}\r
+\r
+ @Override\r
+ public void onTextChanged(CharSequence s, int start, int before, int count) {}\r
+ \r
+ });\r
mPasswordInput.setOnFocusChangeListener(this);\r
mPasswordInput.setImeOptions(EditorInfo.IME_ACTION_DONE);\r
mPasswordInput.setOnEditorActionListener(this);\r
private void onUrlInputFocusLost(TextView hostInput) {\r
if (!mHostBaseUrl.equals(normalizeUrl(mHostUrlInput.getText().toString()))) {\r
checkOcServer();\r
+ } else {\r
+ mOkButton.setEnabled(mServerIsValid);\r
}\r
}\r
\r
\r
\r
private void showViewPasswordButton() {\r
- int drawable = android.R.drawable.ic_menu_view;\r
+ //int drawable = android.R.drawable.ic_menu_view;\r
+ int drawable = R.drawable.ic_view;\r
if (isPasswordVisible()) {\r
- drawable = android.R.drawable.ic_secure;\r
+ //drawable = android.R.drawable.ic_secure;\r
+ drawable = R.drawable.ic_hide;\r
}\r
mPasswordInput.setCompoundDrawablesWithIntrinsicBounds(0, 0, drawable, 0);\r
}\r
url = url.substring(0, url.length() - 1);\r
}\r
}\r
- return url;\r
+ return (url != null ? url : "");\r
}\r
\r
/**\r
\r
private abstract static class RightDrawableOnTouchListener implements OnTouchListener {\r
\r
- private int fuzz = 10;\r
+ private int fuzz = 75;\r
\r
/**\r
* {@inheritDoc}\r