diff options
author | Arne Schwabe <arne@rfc2549.org> | 2013-10-07 16:40:55 +0200 |
---|---|---|
committer | Arne Schwabe <arne@rfc2549.org> | 2013-10-07 16:40:55 +0200 |
commit | 7997868109c0831f2c6d97f342a7e6c6226bf54d (patch) | |
tree | 106e658ecc981ce8ba093a19a6b11c7f9d560fee /src/de/blinkt | |
parent | 9ce9913250cb1122f879cb4a59227c02b42075f7 (diff) |
Add "show password" to popup password dialog
Diffstat (limited to 'src/de/blinkt')
-rw-r--r-- | src/de/blinkt/openvpn/LaunchVPN.java | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/src/de/blinkt/openvpn/LaunchVPN.java b/src/de/blinkt/openvpn/LaunchVPN.java index 336de255..75c88300 100644 --- a/src/de/blinkt/openvpn/LaunchVPN.java +++ b/src/de/blinkt/openvpn/LaunchVPN.java @@ -20,13 +20,8 @@ import android.text.InputType; import android.text.TextUtils; import android.text.method.PasswordTransformationMethod; import android.view.View; -import android.widget.AdapterView; +import android.widget.*; import android.widget.AdapterView.OnItemClickListener; -import android.widget.ArrayAdapter; -import android.widget.CheckBox; -import android.widget.EditText; -import android.widget.ListView; -import android.widget.TextView; import de.blinkt.openvpn.core.VpnStatus; import de.blinkt.openvpn.core.VpnStatus.ConnectionStatus; import de.blinkt.openvpn.core.ProfileManager; @@ -219,6 +214,15 @@ public class LaunchVPN extends ListActivity implements OnItemClickListener { ((EditText)userpwlayout.findViewById(R.id.username)).setText(mSelectedProfile.mUsername); ((EditText)userpwlayout.findViewById(R.id.password)).setText(mSelectedProfile.mPassword); ((CheckBox)userpwlayout.findViewById(R.id.save_password)).setChecked(!TextUtils.isEmpty(mSelectedProfile.mPassword)); + ((CheckBox)userpwlayout.findViewById(R.id.show_password)).setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() { + @Override + public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) { + if (isChecked) + ((EditText)userpwlayout.findViewById(R.id.password)).setInputType(InputType.TYPE_CLASS_TEXT | InputType.TYPE_TEXT_VARIATION_VISIBLE_PASSWORD); + else + ((EditText)userpwlayout.findViewById(R.id.password)).setInputType(InputType.TYPE_CLASS_TEXT | InputType.TYPE_TEXT_VARIATION_PASSWORD); + } + }); dialog.setView(userpwlayout); } else { |