From a495627d72990f0ce6cb795d5e2d9dae3df523fe Mon Sep 17 00:00:00 2001 From: pylerSM Date: Mon, 18 Aug 2014 13:06:25 +0200 Subject: [PATCH] Show password feature --- res/layout/account_setup_basics.xml | 6 ++++ res/values/strings.xml | 2 ++ .../k9/activity/setup/AccountSetupBasics.java | 34 +++++++++++++++---- 3 files changed, 35 insertions(+), 7 deletions(-) diff --git a/res/layout/account_setup_basics.xml b/res/layout/account_setup_basics.xml index 2c4028414..e64a379cf 100644 --- a/res/layout/account_setup_basics.xml +++ b/res/layout/account_setup_basics.xml @@ -34,6 +34,12 @@ android:layout_width="fill_parent" android:nextFocusDown="@+id/next" /> + Saving draft Fetching attachment… + Show password + Decrypting/Verifying… Successful decryption diff --git a/src/com/fsck/k9/activity/setup/AccountSetupBasics.java b/src/com/fsck/k9/activity/setup/AccountSetupBasics.java index 421e56368..e0ca5f484 100644 --- a/src/com/fsck/k9/activity/setup/AccountSetupBasics.java +++ b/src/com/fsck/k9/activity/setup/AccountSetupBasics.java @@ -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);