Loading app/ui/legacy/src/main/java/com/fsck/k9/activity/setup/AccountSetupBasics.java +17 −12 Original line number Diff line number Diff line Loading @@ -8,6 +8,7 @@ import android.text.Editable; import android.text.TextWatcher; import android.view.View; import android.view.View.OnClickListener; import android.view.ViewGroup; import android.widget.Button; import android.widget.CheckBox; import android.widget.CompoundButton; Loading Loading @@ -60,6 +61,7 @@ public class AccountSetupBasics extends K9Activity private Button mNextButton; private Button mManualSetupButton; private Account mAccount; private ViewGroup mAllowClientCertificateView; private EmailAddressValidator mEmailValidator = new EmailAddressValidator(); private boolean mCheckedIncoming = false; Loading @@ -77,6 +79,8 @@ public class AccountSetupBasics extends K9Activity mPasswordView = findViewById(R.id.account_password); mClientCertificateCheckBox = findViewById(R.id.account_client_certificate); mClientCertificateSpinner = findViewById(R.id.account_client_certificate_spinner); mAllowClientCertificateView = findViewById(R.id.account_allow_client_certificate); mNextButton = findViewById(R.id.next); mManualSetupButton = findViewById(R.id.manual_setup); mNextButton.setOnClickListener(this); Loading Loading @@ -151,21 +155,19 @@ public class AccountSetupBasics extends K9Activity updateViewVisibility(isChecked); validateFields(); // Have the user select (or confirm) the client certificate if (isChecked) { // Have the user select the client certificate if not already selected if ((isChecked) && (mClientCertificateSpinner.getAlias() == null)) { mClientCertificateSpinner.chooseCertificate(); } } private void updateViewVisibility(boolean usingCertificates) { if (usingCertificates) { // hide password fields, show client certificate spinner mPasswordView.setVisibility(View.GONE); mClientCertificateSpinner.setVisibility(View.VISIBLE); // show client certificate spinner mAllowClientCertificateView.setVisibility(View.VISIBLE); } else { // show password fields, hide client certificate spinner mPasswordView.setVisibility(View.VISIBLE); mClientCertificateSpinner.setVisibility(View.GONE); // hide client certificate spinner mAllowClientCertificateView.setVisibility(View.GONE); } } Loading Loading @@ -314,12 +316,15 @@ public class AccountSetupBasics extends K9Activity String password = null; String clientCertificateAlias = null; AuthType authenticationType; if (mClientCertificateCheckBox.isChecked()) { authenticationType = AuthType.EXTERNAL; clientCertificateAlias = mClientCertificateSpinner.getAlias(); } else { authenticationType = AuthType.PLAIN; password = mPasswordView.getText().toString(); if (mClientCertificateCheckBox.isChecked()) { clientCertificateAlias = mClientCertificateSpinner.getAlias(); if (mPasswordView.getText().toString().equals("")) { authenticationType = AuthType.EXTERNAL; password = null; } } if (mAccount == null) { Loading app/ui/legacy/src/main/res/layout/account_setup_basics.xml +17 −2 Original line number Diff line number Diff line <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:tools="http://schemas.android.com/tools" android:orientation="vertical" android:layout_height="match_parent" android:layout_width="match_parent"> Loading Loading @@ -48,12 +49,26 @@ android:inputType="textPassword" android:nextFocusDown="@+id/next"/> </com.google.android.material.textfield.TextInputLayout> <LinearLayout android:id="@+id/account_allow_client_certificate" android:layout_width="match_parent" android:layout_height="wrap_content" android:orientation="vertical" android:visibility="gone" tools:visibility="visible"> <TextView android:text="@string/account_setup_incoming_client_certificate_label" android:layout_height="wrap_content" android:layout_width="match_parent" style="@style/InputLabel" android:layout_marginTop="6dp"/> <com.fsck.k9.view.ClientCertificateSpinner android:id="@+id/account_client_certificate_spinner" android:layout_width="match_parent" android:layout_height="wrap_content" android:visibility="gone" /> android:layout_height="wrap_content" /> </LinearLayout> <com.fsck.k9.view.FoldableLinearLayout android:id="@+id/foldable_advanced_options" Loading Loading
app/ui/legacy/src/main/java/com/fsck/k9/activity/setup/AccountSetupBasics.java +17 −12 Original line number Diff line number Diff line Loading @@ -8,6 +8,7 @@ import android.text.Editable; import android.text.TextWatcher; import android.view.View; import android.view.View.OnClickListener; import android.view.ViewGroup; import android.widget.Button; import android.widget.CheckBox; import android.widget.CompoundButton; Loading Loading @@ -60,6 +61,7 @@ public class AccountSetupBasics extends K9Activity private Button mNextButton; private Button mManualSetupButton; private Account mAccount; private ViewGroup mAllowClientCertificateView; private EmailAddressValidator mEmailValidator = new EmailAddressValidator(); private boolean mCheckedIncoming = false; Loading @@ -77,6 +79,8 @@ public class AccountSetupBasics extends K9Activity mPasswordView = findViewById(R.id.account_password); mClientCertificateCheckBox = findViewById(R.id.account_client_certificate); mClientCertificateSpinner = findViewById(R.id.account_client_certificate_spinner); mAllowClientCertificateView = findViewById(R.id.account_allow_client_certificate); mNextButton = findViewById(R.id.next); mManualSetupButton = findViewById(R.id.manual_setup); mNextButton.setOnClickListener(this); Loading Loading @@ -151,21 +155,19 @@ public class AccountSetupBasics extends K9Activity updateViewVisibility(isChecked); validateFields(); // Have the user select (or confirm) the client certificate if (isChecked) { // Have the user select the client certificate if not already selected if ((isChecked) && (mClientCertificateSpinner.getAlias() == null)) { mClientCertificateSpinner.chooseCertificate(); } } private void updateViewVisibility(boolean usingCertificates) { if (usingCertificates) { // hide password fields, show client certificate spinner mPasswordView.setVisibility(View.GONE); mClientCertificateSpinner.setVisibility(View.VISIBLE); // show client certificate spinner mAllowClientCertificateView.setVisibility(View.VISIBLE); } else { // show password fields, hide client certificate spinner mPasswordView.setVisibility(View.VISIBLE); mClientCertificateSpinner.setVisibility(View.GONE); // hide client certificate spinner mAllowClientCertificateView.setVisibility(View.GONE); } } Loading Loading @@ -314,12 +316,15 @@ public class AccountSetupBasics extends K9Activity String password = null; String clientCertificateAlias = null; AuthType authenticationType; if (mClientCertificateCheckBox.isChecked()) { authenticationType = AuthType.EXTERNAL; clientCertificateAlias = mClientCertificateSpinner.getAlias(); } else { authenticationType = AuthType.PLAIN; password = mPasswordView.getText().toString(); if (mClientCertificateCheckBox.isChecked()) { clientCertificateAlias = mClientCertificateSpinner.getAlias(); if (mPasswordView.getText().toString().equals("")) { authenticationType = AuthType.EXTERNAL; password = null; } } if (mAccount == null) { Loading
app/ui/legacy/src/main/res/layout/account_setup_basics.xml +17 −2 Original line number Diff line number Diff line <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:tools="http://schemas.android.com/tools" android:orientation="vertical" android:layout_height="match_parent" android:layout_width="match_parent"> Loading Loading @@ -48,12 +49,26 @@ android:inputType="textPassword" android:nextFocusDown="@+id/next"/> </com.google.android.material.textfield.TextInputLayout> <LinearLayout android:id="@+id/account_allow_client_certificate" android:layout_width="match_parent" android:layout_height="wrap_content" android:orientation="vertical" android:visibility="gone" tools:visibility="visible"> <TextView android:text="@string/account_setup_incoming_client_certificate_label" android:layout_height="wrap_content" android:layout_width="match_parent" style="@style/InputLabel" android:layout_marginTop="6dp"/> <com.fsck.k9.view.ClientCertificateSpinner android:id="@+id/account_client_certificate_spinner" android:layout_width="match_parent" android:layout_height="wrap_content" android:visibility="gone" /> android:layout_height="wrap_content" /> </LinearLayout> <com.fsck.k9.view.FoldableLinearLayout android:id="@+id/foldable_advanced_options" Loading