\r
package com.owncloud.android.authentication;\r
\r
-import java.security.spec.MGF1ParameterSpec;\r
-\r
-import com.owncloud.android.AccountUtils;\r
import com.owncloud.android.Log_OC;\r
import com.owncloud.android.ui.dialog.SslValidatorDialog;\r
import com.owncloud.android.ui.dialog.SslValidatorDialog.OnSslValidatorListener;\r
import android.widget.CheckBox;\r
import android.widget.EditText;\r
import android.widget.Button;\r
-import android.widget.ImageButton;\r
import android.widget.TextView;\r
import android.widget.Toast;\r
import android.widget.TextView.OnEditorActionListener;\r
private Account mAccount;\r
\r
private EditText mHostUrlInput;\r
- private ImageButton mRefreshButton;\r
+ private View mRefreshButton;\r
private EditText mUsernameInput;\r
private EditText mPasswordInput;\r
private CheckBox mOAuth2Check;\r
private TextView mOAuthTokenEndpointText;\r
\r
private boolean mRefreshButtonEnabled;\r
+ \r
+ private boolean mHostUrlInputEnabled;\r
\r
\r
/**\r
/// set view and get references to view elements\r
setContentView(R.layout.account_setup);\r
mHostUrlInput = (EditText) findViewById(R.id.hostUrlInput);\r
- mRefreshButton = (ImageButton) findViewById(R.id.refeshButton);\r
mUsernameInput = (EditText) findViewById(R.id.account_username);\r
mPasswordInput = (EditText) findViewById(R.id.account_password);\r
mOAuthAuthEndpointText = (TextView)findViewById(R.id.oAuthEntryPoint_1);\r
mOAuth2Check = (CheckBox) findViewById(R.id.oauth_onOff_check);\r
mOkButton = findViewById(R.id.buttonOK);\r
mAuthStatusLayout = (TextView) findViewById(R.id.auth_status_text); \r
+ \r
+ /// set Host Url Input Enabled\r
+ mHostUrlInputEnabled = getResources().getBoolean(R.bool.show_server_url_input);\r
+ \r
\r
/// complete label for 'register account' button\r
Button b = (Button) findViewById(R.id.account_register);\r
mAccount = null;\r
mHostBaseUrl = "";\r
boolean refreshButtonEnabled = false;\r
+ \r
+ // URL input configuration applied\r
+ if (!mHostUrlInputEnabled)\r
+ {\r
+ mHostUrlInput.setText(getString(R.string.server_url));\r
+ findViewById(R.id.hostUrlFrame).setVisibility(View.GONE);\r
+ \r
+ mRefreshButton = findViewById(R.id.centeredRefreshButton);\r
+\r
+ } else {\r
+ mRefreshButton = findViewById(R.id.embeddedRefreshButton);\r
+ }\r
\r
if (savedInstanceState == null) {\r
/// connection state and info\r
changeViewByOAuth2Check(oAuthRequired);\r
mJustCreated = true;\r
\r
- if (mAction == ACTION_UPDATE_TOKEN) {\r
+ if (mAction == ACTION_UPDATE_TOKEN || !mHostUrlInputEnabled) {\r
checkOcServer(); \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
checkOcServer();\r
} else {\r
mOkButton.setEnabled(mServerIsValid);\r
+ if (!mServerIsValid) {\r
+ showRefreshButton();\r
+ }\r
}\r
}\r
\r
\r
private void checkOcServer() {\r
String uri = trimUrlWebdav(mHostUrlInput.getText().toString().trim());\r
+ \r
+ if (!mHostUrlInputEnabled){\r
+ uri = getString(R.string.server_url);\r
+ }\r
+ \r
mServerIsValid = false;\r
mServerIsChecked = false;\r
mOkButton.setEnabled(false);\r
\r
\r
private void showRefreshButton() {\r
- /*mHostUrlInput.setCompoundDrawablesWithIntrinsicBounds(0, 0, R.drawable.ic_action_refresh_black, 0);\r
- mRefreshButtonEnabled = true;*/\r
mRefreshButton.setVisibility(View.VISIBLE);\r
}\r
\r
private void hideRefreshButton() {\r
- /*mHostUrlInput.setCompoundDrawablesWithIntrinsicBounds(0, 0, 0, 0);\r
- mRefreshButtonEnabled = false;*/\r
mRefreshButton.setVisibility(View.GONE);\r
}\r
\r
* Called from SslValidatorDialog when a new server certificate was correctly saved.\r
*/\r
public void onSavedCertificate() {\r
- mOperationThread = mOcServerChkOperation.retry(this, mHandler); \r
+ checkOcServer();\r
}\r
\r
/**\r