src/org/gege/caldavsyncadapter/authenticator/AuthenticatorActivity.java

changeset 9
bcc778a42b8c
parent 8
ec8af0e3fbc2
     1.1 --- a/src/org/gege/caldavsyncadapter/authenticator/AuthenticatorActivity.java	Tue Feb 10 22:40:00 2015 +0100
     1.2 +++ b/src/org/gege/caldavsyncadapter/authenticator/AuthenticatorActivity.java	Tue Feb 10 22:48:00 2015 +0100
     1.3 @@ -33,6 +33,7 @@
     1.4  import android.os.Build;
     1.5  import android.os.Bundle;
     1.6  import android.text.Editable;
     1.7 +import android.text.InputType;
     1.8  import android.text.TextUtils;
     1.9  import android.text.TextWatcher;
    1.10  import android.util.Log;
    1.11 @@ -41,6 +42,7 @@
    1.12  import android.view.View;
    1.13  import android.view.inputmethod.EditorInfo;
    1.14  import android.widget.CheckBox;
    1.15 +import android.widget.CompoundButton;
    1.16  import android.widget.EditText;
    1.17  import android.widget.TextView;
    1.18  import android.widget.Toast;
    1.19 @@ -109,6 +111,8 @@
    1.20      private String mAccountname;
    1.21      private EditText mAccountnameView;
    1.22  
    1.23 +    private CheckBox showPassword;
    1.24 +
    1.25      public AuthenticatorActivity() {
    1.26          super();
    1.27  
    1.28 @@ -126,6 +130,7 @@
    1.29          mUser = getIntent().getStringExtra(EXTRA_EMAIL);
    1.30          mUserView = (EditText) findViewById(R.id.user);
    1.31          mUserView.setText(mUser);
    1.32 +        mUserView.requestFocus();
    1.33  
    1.34          mContext = getBaseContext();
    1.35  
    1.36 @@ -143,6 +148,17 @@
    1.37                      }
    1.38                  });
    1.39  
    1.40 +        showPassword = (CheckBox) findViewById(R.id.showPassword);
    1.41 +        showPassword.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
    1.42 +            @Override
    1.43 +            public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
    1.44 +                if(isChecked) {
    1.45 +                    mPasswordView.setInputType(InputType.TYPE_CLASS_TEXT | InputType.TYPE_TEXT_VARIATION_VISIBLE_PASSWORD);
    1.46 +                } else {
    1.47 +                    mPasswordView.setInputType(InputType.TYPE_CLASS_TEXT | InputType.TYPE_TEXT_VARIATION_PASSWORD);
    1.48 +                }
    1.49 +            }
    1.50 +        });
    1.51  
    1.52          mURLView = (EditText) findViewById(R.id.url);
    1.53          // if the URL start with "https" show the option to disable SSL host verification
    1.54 @@ -508,4 +524,4 @@
    1.55              showProgress(false);
    1.56          }
    1.57      }
    1.58 -}
    1.59 \ No newline at end of file
    1.60 +}

mercurial