diff --git a/mage/src/main/java/mil/nga/giat/mage/login/LoginActivity.java b/mage/src/main/java/mil/nga/giat/mage/login/LoginActivity.java index ffdbfbfad..1474892c9 100644 --- a/mage/src/main/java/mil/nga/giat/mage/login/LoginActivity.java +++ b/mage/src/main/java/mil/nga/giat/mage/login/LoginActivity.java @@ -212,19 +212,16 @@ public void togglePassword(View v) { } private void configureLogin() { - boolean noServer = StringUtils.isEmpty(mServerURL.getText()); - findViewById(R.id.login_form).setVisibility(noServer ? View.GONE : View.VISIBLE); - findViewById(R.id.server_configuration).setVisibility(noServer ? View.VISIBLE : View.GONE); - PreferenceHelper preferenceHelper = PreferenceHelper.getInstance(getApplicationContext()); + + boolean noServer = StringUtils.isEmpty(mServerURL.getText()); boolean localAuthentication = preferenceHelper.containsLocalAuthentication(); boolean googleAuthentication = preferenceHelper.containsGoogleAuthentication(); - if (localAuthentication && googleAuthentication) { - findViewById(R.id.or).setVisibility(View.VISIBLE); - } else { - findViewById(R.id.or).setVisibility(View.GONE); - } + findViewById(R.id.login_form).setVisibility(noServer ? View.GONE : View.VISIBLE); + findViewById(R.id.server_configuration).setVisibility(noServer ? View.VISIBLE : View.GONE); + findViewById(R.id.or).setVisibility(localAuthentication && googleAuthentication ? View.VISIBLE : View.GONE); + findViewById(R.id.sign_up).setVisibility(localAuthentication || googleAuthentication ? View.VISIBLE : View.GONE); if (localAuthentication) { Button localButton = (Button) findViewById(R.id.local_login_button); @@ -332,7 +329,8 @@ public void onClick(View view) { @Override public boolean apply(Exception e) { if (e == null) { - mServerURL.setText(serverURL); + getServerUrlText().setText(serverURL); + getServerUrlText().setError(null); mLoginButton.setEnabled(true); serverEditText.setError(null); alertDialog.dismiss(); diff --git a/mage/src/main/res/layout/activity_login.xml b/mage/src/main/res/layout/activity_login.xml index 218d0ad95..8cf207a94 100644 --- a/mage/src/main/res/layout/activity_login.xml +++ b/mage/src/main/res/layout/activity_login.xml @@ -200,6 +200,7 @@