private static final String KEY_IS_SSL_CONN = "IS_SSL_CONN";\r
private static final String KEY_AUTH_STATUS_TEXT = "AUTH_STATUS_TEXT";\r
private static final String KEY_AUTH_STATUS_ICON = "AUTH_STATUS_ICON";\r
+ private static final String KEY_REFRESH_BUTTON_ENABLED = "KEY_REFRESH_BUTTON_ENABLED";\r
\r
private static final String OAUTH_MODE_ON = "on";\r
private static final String OAUTH_MODE_OFF = "off";\r
\r
private TextView mOAuthAuthEndpointText;\r
private TextView mOAuthTokenEndpointText;\r
+ \r
+ private boolean mRefreshButtonEnabled;\r
\r
\r
/**\r
// check if server check was interrupted by a configuration change\r
if (savedInstanceState.getBoolean(KEY_SERVER_CHECK_IN_PROGRESS, false)) {\r
checkOcServer();\r
- }\r
+ } \r
+ \r
+ // refresh button enabled\r
+ mRefreshButtonEnabled = savedInstanceState.getBoolean(KEY_REFRESH_BUTTON_ENABLED);\r
\r
}\r
\r
showServerStatus();\r
showAuthStatus();\r
- if (mServerIsChecked && !mServerIsValid) showRefreshButton();\r
+ if (mServerIsChecked && !mServerIsValid && mRefreshButtonEnabled) showRefreshButton();\r
mOkButton.setEnabled(mServerIsValid); // state not automatically recovered in configuration changes\r
\r
if (!OAUTH_MODE_OPTIONAL.equals(getString(R.string.oauth2_mode))) {\r
mPasswordInput.setOnFocusChangeListener(this);\r
mPasswordInput.setImeOptions(EditorInfo.IME_ACTION_DONE);\r
mPasswordInput.setOnEditorActionListener(this);\r
+\r
}\r
\r
/**\r
if (mAccount != null) {\r
outState.putParcelable(KEY_ACCOUNT, mAccount);\r
}\r
+ \r
+ // refresh button enabled\r
+ outState.putBoolean(KEY_REFRESH_BUTTON_ENABLED, mRefreshButtonEnabled);\r
\r
}\r
\r
if (view.getId() == R.id.hostUrlInput) { \r
if (!hasFocus) {\r
onUrlInputFocusLost((TextView) view);\r
+ if (!mServerIsValid) {\r
+ showRefreshButton();\r
+ }\r
}\r
else {\r
hideRefreshButton();\r
\r
private void showRefreshButton() {\r
mHostUrlInput.setCompoundDrawablesWithIntrinsicBounds(0, 0, R.drawable.ic_action_refresh_black, 0);\r
+ mRefreshButtonEnabled = true;\r
}\r
\r
private void hideRefreshButton() {\r
mHostUrlInput.setCompoundDrawablesWithIntrinsicBounds(0, 0, 0, 0);\r
+ mRefreshButtonEnabled = false;\r
}\r
\r
/**\r