mirror of
https://github.com/moparisthebest/k-9
synced 2025-02-17 07:30:16 -05:00
Additional 'Show password' changes after merging master
This commit is contained in:
parent
1783dd1a63
commit
c472b89d23
@ -38,7 +38,7 @@
|
||||
android:id="@+id/show_password"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_width="fill_parent"
|
||||
android:text="@string/show_password"
|
||||
android:text="@string/account_setup_basics_show_password"
|
||||
/>
|
||||
<com.fsck.k9.view.ClientCertificateSpinner
|
||||
android:id="@+id/account_client_certificate_spinner"
|
||||
|
@ -352,6 +352,7 @@ Please submit bug reports, contribute new features and ask questions at
|
||||
<string name="account_setup_basics_title">Set up a new account</string>
|
||||
<string name="account_setup_basics_email_hint">Email address</string>
|
||||
<string name="account_setup_basics_password_hint">Password</string>
|
||||
<string name="account_setup_basics_show_password">Show password</string>
|
||||
<string name="account_setup_basics_manual_setup_action">Manual setup</string>
|
||||
|
||||
<string name="account_setup_check_settings_title"/>
|
||||
@ -1109,8 +1110,6 @@ Please submit bug reports, contribute new features and ask questions at
|
||||
|
||||
<string name="auth_external_error">Unable to authenticate. The server does not advertise the SASL EXTERNAL capability. This could be due to a problem with the client certificate (expired, unknown certificate authority) or some other configuration problem.</string>
|
||||
|
||||
<string name="show_password">Show password</string>
|
||||
|
||||
<!-- === OpenPGP specific ================================================================== -->
|
||||
<string name="openpgp_decrypting_verifying">Decrypting/Verifying…</string>
|
||||
<string name="openpgp_successful_decryption">Successful decryption</string>
|
||||
|
@ -73,6 +73,7 @@ public class AccountSetupBasics extends K9Activity
|
||||
|
||||
private EmailAddressValidator mEmailValidator = new EmailAddressValidator();
|
||||
private boolean mCheckedIncoming = false;
|
||||
private CheckBox mShowPasswordCheckBox;
|
||||
|
||||
public static void actionNewAccount(Context context) {
|
||||
Intent i = new Intent(context, AccountSetupBasics.class);
|
||||
@ -89,18 +90,7 @@ public class AccountSetupBasics extends K9Activity
|
||||
mClientCertificateSpinner = (ClientCertificateSpinner)findViewById(R.id.account_client_certificate_spinner);
|
||||
mNextButton = (Button)findViewById(R.id.next);
|
||||
mManualSetupButton = (Button)findViewById(R.id.manual_setup);
|
||||
CheckBox showPassword = (CheckBox) findViewById(R.id.show_password);
|
||||
showPassword.setOnCheckedChangeListener (new OnCheckedChangeListener() {
|
||||
@Override
|
||||
public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
|
||||
if (isChecked) {
|
||||
mPasswordView.setInputType(InputType.TYPE_TEXT_VARIATION_PASSWORD);
|
||||
} else {
|
||||
mPasswordView.setInputType(InputType.TYPE_CLASS_TEXT | InputType.TYPE_TEXT_VARIATION_PASSWORD);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
mShowPasswordCheckBox = (CheckBox) findViewById(R.id.show_password);
|
||||
mNextButton.setOnClickListener(this);
|
||||
mManualSetupButton.setOnClickListener(this);
|
||||
}
|
||||
@ -110,6 +100,13 @@ public class AccountSetupBasics extends K9Activity
|
||||
mPasswordView.addTextChangedListener(this);
|
||||
mClientCertificateCheckBox.setOnCheckedChangeListener(this);
|
||||
mClientCertificateSpinner.setOnClientCertificateChangedListener(this);
|
||||
mShowPasswordCheckBox.setOnCheckedChangeListener (new OnCheckedChangeListener() {
|
||||
@Override
|
||||
public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
|
||||
showPassword(isChecked);
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -141,6 +138,7 @@ public class AccountSetupBasics extends K9Activity
|
||||
|
||||
updateViewVisibility(mClientCertificateCheckBox.isChecked());
|
||||
|
||||
showPassword(mShowPasswordCheckBox.isChecked());
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -191,14 +189,24 @@ public class AccountSetupBasics extends K9Activity
|
||||
if (usingCertificates) {
|
||||
// hide password fields, show client certificate spinner
|
||||
mPasswordView.setVisibility(View.GONE);
|
||||
mShowPasswordCheckBox.setVisibility(View.GONE);
|
||||
mClientCertificateSpinner.setVisibility(View.VISIBLE);
|
||||
} else {
|
||||
// show password fields, hide client certificate spinner
|
||||
mPasswordView.setVisibility(View.VISIBLE);
|
||||
mShowPasswordCheckBox.setVisibility(View.VISIBLE);
|
||||
mClientCertificateSpinner.setVisibility(View.GONE);
|
||||
}
|
||||
}
|
||||
|
||||
private void showPassword(boolean show) {
|
||||
if (show) {
|
||||
mPasswordView.setInputType(InputType.TYPE_TEXT_VARIATION_PASSWORD);
|
||||
} else {
|
||||
mPasswordView.setInputType(InputType.TYPE_CLASS_TEXT | InputType.TYPE_TEXT_VARIATION_PASSWORD);
|
||||
}
|
||||
}
|
||||
|
||||
private void validateFields() {
|
||||
boolean clientCertificateChecked = mClientCertificateCheckBox.isChecked();
|
||||
String clientCertificateAlias = mClientCertificateSpinner.getAlias();
|
||||
|
Loading…
Reference in New Issue
Block a user