1
0
mirror of https://github.com/moparisthebest/k-9 synced 2024-11-30 13:12:25 -05:00

Merge pull request #490 from pylerSM/master

Add 'Show password' check box to account setup screen
This commit is contained in:
cketti 2014-08-18 22:30:06 +02:00
commit 3bd9e7edf1
3 changed files with 35 additions and 7 deletions

View File

@ -34,6 +34,12 @@
android:layout_width="fill_parent"
android:nextFocusDown="@+id/next"
/>
<CheckBox
android:id="@+id/show_password"
android:layout_height="wrap_content"
android:layout_width="fill_parent"
android:text="@string/show_password"
/>
<View
android:layout_width="fill_parent"
android:layout_height="0dip"

View File

@ -1103,6 +1103,8 @@ Please submit bug reports, contribute new features and ask questions at
<string name="fetching_attachment_dialog_title_save">Saving draft</string>
<string name="fetching_attachment_dialog_message">Fetching attachment…</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>

View File

@ -1,6 +1,13 @@
package com.fsck.k9.activity.setup;
import java.io.Serializable;
import java.io.UnsupportedEncodingException;
import java.net.URI;
import java.net.URISyntaxException;
import java.net.URLEncoder;
import java.util.Locale;
import android.app.AlertDialog;
import android.app.Dialog;
import android.content.Context;
@ -9,22 +16,24 @@ import android.content.Intent;
import android.content.res.XmlResourceParser;
import android.os.Bundle;
import android.text.Editable;
import android.text.InputType;
import android.text.TextWatcher;
import android.util.Log;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.CheckBox;
import android.widget.CompoundButton;
import android.widget.CompoundButton.OnCheckedChangeListener;
import android.widget.EditText;
import com.fsck.k9.*;
import com.fsck.k9.Account;
import com.fsck.k9.EmailAddressValidator;
import com.fsck.k9.K9;
import com.fsck.k9.Preferences;
import com.fsck.k9.R;
import com.fsck.k9.activity.K9Activity;
import com.fsck.k9.activity.setup.AccountSetupCheckSettings.CheckDirection;
import com.fsck.k9.helper.Utility;
import java.io.Serializable;
import java.io.UnsupportedEncodingException;
import java.net.URI;
import java.net.URISyntaxException;
import java.net.URLEncoder;
import java.util.Locale;
/**
* Prompts the user for the email address and password.
@ -65,6 +74,17 @@ public class AccountSetupBasics extends K9Activity
mPasswordView = (EditText)findViewById(R.id.account_password);
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);
}
}
});
mNextButton.setOnClickListener(this);
mManualSetupButton.setOnClickListener(this);