@@ -212,19 +212,16 @@ public void togglePassword(View v) {
212212 }
213213
214214 private void configureLogin () {
215- boolean noServer = StringUtils .isEmpty (mServerURL .getText ());
216- findViewById (R .id .login_form ).setVisibility (noServer ? View .GONE : View .VISIBLE );
217- findViewById (R .id .server_configuration ).setVisibility (noServer ? View .VISIBLE : View .GONE );
218-
219215 PreferenceHelper preferenceHelper = PreferenceHelper .getInstance (getApplicationContext ());
216+
217+ boolean noServer = StringUtils .isEmpty (mServerURL .getText ());
220218 boolean localAuthentication = preferenceHelper .containsLocalAuthentication ();
221219 boolean googleAuthentication = preferenceHelper .containsGoogleAuthentication ();
222220
223- if (localAuthentication && googleAuthentication ) {
224- findViewById (R .id .or ).setVisibility (View .VISIBLE );
225- } else {
226- findViewById (R .id .or ).setVisibility (View .GONE );
227- }
221+ findViewById (R .id .login_form ).setVisibility (noServer ? View .GONE : View .VISIBLE );
222+ findViewById (R .id .server_configuration ).setVisibility (noServer ? View .VISIBLE : View .GONE );
223+ findViewById (R .id .or ).setVisibility (localAuthentication && googleAuthentication ? View .VISIBLE : View .GONE );
224+ findViewById (R .id .sign_up ).setVisibility (localAuthentication || googleAuthentication ? View .VISIBLE : View .GONE );
228225
229226 if (localAuthentication ) {
230227 Button localButton = (Button ) findViewById (R .id .local_login_button );
@@ -332,7 +329,8 @@ public void onClick(View view) {
332329 @ Override
333330 public boolean apply (Exception e ) {
334331 if (e == null ) {
335- mServerURL .setText (serverURL );
332+ getServerUrlText ().setText (serverURL );
333+ getServerUrlText ().setError (null );
336334 mLoginButton .setEnabled (true );
337335 serverEditText .setError (null );
338336 alertDialog .dismiss ();
0 commit comments