31 import android.content.pm.PackageManager.NameNotFoundException; |
31 import android.content.pm.PackageManager.NameNotFoundException; |
32 import android.os.AsyncTask; |
32 import android.os.AsyncTask; |
33 import android.os.Build; |
33 import android.os.Build; |
34 import android.os.Bundle; |
34 import android.os.Bundle; |
35 import android.text.Editable; |
35 import android.text.Editable; |
|
36 import android.text.InputType; |
36 import android.text.TextUtils; |
37 import android.text.TextUtils; |
37 import android.text.TextWatcher; |
38 import android.text.TextWatcher; |
38 import android.util.Log; |
39 import android.util.Log; |
39 import android.view.KeyEvent; |
40 import android.view.KeyEvent; |
40 import android.view.Menu; |
41 import android.view.Menu; |
41 import android.view.View; |
42 import android.view.View; |
42 import android.view.inputmethod.EditorInfo; |
43 import android.view.inputmethod.EditorInfo; |
43 import android.widget.CheckBox; |
44 import android.widget.CheckBox; |
|
45 import android.widget.CompoundButton; |
44 import android.widget.EditText; |
46 import android.widget.EditText; |
45 import android.widget.TextView; |
47 import android.widget.TextView; |
46 import android.widget.Toast; |
48 import android.widget.Toast; |
47 |
49 |
48 import org.apache.http.conn.HttpHostConnectException; |
50 import org.apache.http.conn.HttpHostConnectException; |
124 |
128 |
125 // Set up the login form. |
129 // Set up the login form. |
126 mUser = getIntent().getStringExtra(EXTRA_EMAIL); |
130 mUser = getIntent().getStringExtra(EXTRA_EMAIL); |
127 mUserView = (EditText) findViewById(R.id.user); |
131 mUserView = (EditText) findViewById(R.id.user); |
128 mUserView.setText(mUser); |
132 mUserView.setText(mUser); |
|
133 mUserView.requestFocus(); |
129 |
134 |
130 mContext = getBaseContext(); |
135 mContext = getBaseContext(); |
131 |
136 |
132 mPasswordView = (EditText) findViewById(R.id.password); |
137 mPasswordView = (EditText) findViewById(R.id.password); |
133 mPasswordView |
138 mPasswordView |
141 } |
146 } |
142 return false; |
147 return false; |
143 } |
148 } |
144 }); |
149 }); |
145 |
150 |
|
151 showPassword = (CheckBox) findViewById(R.id.showPassword); |
|
152 showPassword.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() { |
|
153 @Override |
|
154 public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) { |
|
155 if(isChecked) { |
|
156 mPasswordView.setInputType(InputType.TYPE_CLASS_TEXT | InputType.TYPE_TEXT_VARIATION_VISIBLE_PASSWORD); |
|
157 } else { |
|
158 mPasswordView.setInputType(InputType.TYPE_CLASS_TEXT | InputType.TYPE_TEXT_VARIATION_PASSWORD); |
|
159 } |
|
160 } |
|
161 }); |
146 |
162 |
147 mURLView = (EditText) findViewById(R.id.url); |
163 mURLView = (EditText) findViewById(R.id.url); |
148 // if the URL start with "https" show the option to disable SSL host verification |
164 // if the URL start with "https" show the option to disable SSL host verification |
149 mURLView.addTextChangedListener(new TextWatcher() { |
165 mURLView.addTextChangedListener(new TextWatcher() { |
150 @Override |
166 @Override |