Merge https://github.com/gggard/AndroidCaldavSyncAdapater/pull/211/

Tue, 10 Feb 2015 22:48:00 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Tue, 10 Feb 2015 22:48:00 +0100
changeset 9
bcc778a42b8c
parent 8
ec8af0e3fbc2
child 10
262b0d479a96

Merge https://github.com/gggard/AndroidCaldavSyncAdapater/pull/211/

res/layout/activity_authenticator.xml file | annotate | diff | comparison | revisions
src/org/gege/caldavsyncadapter/authenticator/AuthenticatorActivity.java file | annotate | diff | comparison | revisions
     1.1 --- a/res/layout/activity_authenticator.xml	Tue Feb 10 22:40:00 2015 +0100
     1.2 +++ b/res/layout/activity_authenticator.xml	Tue Feb 10 22:48:00 2015 +0100
     1.3 @@ -45,9 +45,10 @@
     1.4                  android:layout_width="match_parent"
     1.5                  android:layout_height="wrap_content"
     1.6                  android:hint="@string/prompt_user"
     1.7 -                android:inputType="text"
     1.8                  android:maxLines="1"
     1.9 -                android:singleLine="true" />
    1.10 +                android:singleLine="true"
    1.11 +                android:inputType="text|textEmailAddress"
    1.12 +                />
    1.13  
    1.14              <EditText
    1.15                  android:id="@+id/password"
    1.16 @@ -61,6 +62,14 @@
    1.17                  android:maxLines="1"
    1.18                  android:singleLine="true" />
    1.19  
    1.20 +
    1.21 +            <CheckBox
    1.22 +                android:layout_width="wrap_content"
    1.23 +                android:layout_height="wrap_content"
    1.24 +                android:text="Display Password"
    1.25 +                android:id="@+id/showPassword"
    1.26 +                android:checked="false" />
    1.27 +
    1.28              <EditText
    1.29                  android:id="@+id/url"
    1.30                  android:layout_width="match_parent"
     2.1 --- a/src/org/gege/caldavsyncadapter/authenticator/AuthenticatorActivity.java	Tue Feb 10 22:40:00 2015 +0100
     2.2 +++ b/src/org/gege/caldavsyncadapter/authenticator/AuthenticatorActivity.java	Tue Feb 10 22:48:00 2015 +0100
     2.3 @@ -33,6 +33,7 @@
     2.4  import android.os.Build;
     2.5  import android.os.Bundle;
     2.6  import android.text.Editable;
     2.7 +import android.text.InputType;
     2.8  import android.text.TextUtils;
     2.9  import android.text.TextWatcher;
    2.10  import android.util.Log;
    2.11 @@ -41,6 +42,7 @@
    2.12  import android.view.View;
    2.13  import android.view.inputmethod.EditorInfo;
    2.14  import android.widget.CheckBox;
    2.15 +import android.widget.CompoundButton;
    2.16  import android.widget.EditText;
    2.17  import android.widget.TextView;
    2.18  import android.widget.Toast;
    2.19 @@ -109,6 +111,8 @@
    2.20      private String mAccountname;
    2.21      private EditText mAccountnameView;
    2.22  
    2.23 +    private CheckBox showPassword;
    2.24 +
    2.25      public AuthenticatorActivity() {
    2.26          super();
    2.27  
    2.28 @@ -126,6 +130,7 @@
    2.29          mUser = getIntent().getStringExtra(EXTRA_EMAIL);
    2.30          mUserView = (EditText) findViewById(R.id.user);
    2.31          mUserView.setText(mUser);
    2.32 +        mUserView.requestFocus();
    2.33  
    2.34          mContext = getBaseContext();
    2.35  
    2.36 @@ -143,6 +148,17 @@
    2.37                      }
    2.38                  });
    2.39  
    2.40 +        showPassword = (CheckBox) findViewById(R.id.showPassword);
    2.41 +        showPassword.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
    2.42 +            @Override
    2.43 +            public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
    2.44 +                if(isChecked) {
    2.45 +                    mPasswordView.setInputType(InputType.TYPE_CLASS_TEXT | InputType.TYPE_TEXT_VARIATION_VISIBLE_PASSWORD);
    2.46 +                } else {
    2.47 +                    mPasswordView.setInputType(InputType.TYPE_CLASS_TEXT | InputType.TYPE_TEXT_VARIATION_PASSWORD);
    2.48 +                }
    2.49 +            }
    2.50 +        });
    2.51  
    2.52          mURLView = (EditText) findViewById(R.id.url);
    2.53          // if the URL start with "https" show the option to disable SSL host verification
    2.54 @@ -508,4 +524,4 @@
    2.55              showProgress(false);
    2.56          }
    2.57      }
    2.58 -}
    2.59 \ No newline at end of file
    2.60 +}

mercurial