From e6f393d36c8d19642f64a6e235ea12ab4e08c4df Mon Sep 17 00:00:00 2001 From: M66B Date: Sat, 6 Jan 2024 15:20:05 +0100 Subject: [PATCH] Moved DANE option back --- .../eu/faircode/email/FragmentAccount.java | 9 ++-- .../eu/faircode/email/FragmentIdentity.java | 8 +-- .../java/eu/faircode/email/FragmentPop.java | 8 +-- app/src/main/res/layout/fragment_account.xml | 50 ++++++++++--------- app/src/main/res/layout/fragment_identity.xml | 48 +++++++++--------- app/src/main/res/layout/fragment_pop.xml | 48 +++++++++--------- 6 files changed, 89 insertions(+), 82 deletions(-) diff --git a/app/src/main/java/eu/faircode/email/FragmentAccount.java b/app/src/main/java/eu/faircode/email/FragmentAccount.java index ddd6cb669b..70b3d8d795 100644 --- a/app/src/main/java/eu/faircode/email/FragmentAccount.java +++ b/app/src/main/java/eu/faircode/email/FragmentAccount.java @@ -101,6 +101,8 @@ public class FragmentAccount extends FragmentBase { private RadioGroup rgEncryption; private CheckBox cbInsecure; private TextView tvInsecureRemark; + private CheckBox cbDane; + private EditText etPort; private EditText etUser; private TextInputLayout tilPassword; @@ -140,7 +142,6 @@ public class FragmentAccount extends FragmentBase { private CheckBox cbUnicode; private CheckBox cbUnmetered; private CheckBox cbVpnOnly; - private CheckBox cbDane; private Button btnCheck; private ContentLoadingProgressBar pbCheck; @@ -224,6 +225,7 @@ public class FragmentAccount extends FragmentBase { rgEncryption = view.findViewById(R.id.rgEncryption); cbInsecure = view.findViewById(R.id.cbInsecure); tvInsecureRemark = view.findViewById(R.id.tvInsecureRemark); + cbDane = view.findViewById(R.id.cbDane); etUser = view.findViewById(R.id.etUser); tilPassword = view.findViewById(R.id.tilPassword); tvAppPassword = view.findViewById(R.id.tvAppPassword); @@ -261,7 +263,6 @@ public class FragmentAccount extends FragmentBase { cbUnicode = view.findViewById(R.id.cbUnicode); cbUnmetered = view.findViewById(R.id.cbUnmeteredOnly); cbVpnOnly = view.findViewById(R.id.cbVpnOnly); - cbDane = view.findViewById(R.id.cbDane); btnCheck = view.findViewById(R.id.btnCheck); pbCheck = view.findViewById(R.id.pbCheck); @@ -1687,6 +1688,8 @@ public class FragmentAccount extends FragmentBase { rgEncryption.check(R.id.radio_ssl); cbInsecure.setChecked(account == null ? false : account.insecure); + cbDane.setChecked(account == null ? false : account.dane); + cbDane.setEnabled(!cbInsecure.isChecked()); etUser.setText(account == null ? null : account.user); tilPassword.getEditText().setText(account == null ? null : account.password); @@ -1726,8 +1729,6 @@ public class FragmentAccount extends FragmentBase { cbUnicode.setChecked(account == null ? false : account.unicode); cbUnmetered.setChecked(jcondition.optBoolean("unmetered")); cbVpnOnly.setChecked(jcondition.optBoolean("vpn_only")); - cbDane.setChecked(account == null ? false : account.dane); - cbDane.setEnabled(!cbInsecure.isChecked()); if (account != null && account.use_date) rgDate.check(R.id.radio_date_header); diff --git a/app/src/main/java/eu/faircode/email/FragmentIdentity.java b/app/src/main/java/eu/faircode/email/FragmentIdentity.java index 00ceeddacf..edc655e0da 100644 --- a/app/src/main/java/eu/faircode/email/FragmentIdentity.java +++ b/app/src/main/java/eu/faircode/email/FragmentIdentity.java @@ -102,6 +102,7 @@ public class FragmentIdentity extends FragmentBase { private RadioGroup rgEncryption; private CheckBox cbInsecure; private TextView tvInsecureRemark; + private CheckBox cbDane; private EditText etPort; private EditText etUser; private TextInputLayout tilPassword; @@ -136,7 +137,6 @@ public class FragmentIdentity extends FragmentBase { private CheckBox cbUnicode; private CheckBox cbOctetMime; private EditText etMaxSize; - private CheckBox cbDane; private Button btnSave; private ContentLoadingProgressBar pbSave; @@ -210,6 +210,7 @@ public class FragmentIdentity extends FragmentBase { rgEncryption = view.findViewById(R.id.rgEncryption); cbInsecure = view.findViewById(R.id.cbInsecure); tvInsecureRemark = view.findViewById(R.id.tvInsecureRemark); + cbDane = view.findViewById(R.id.cbDane); etPort = view.findViewById(R.id.etPort); etUser = view.findViewById(R.id.etUser); tilPassword = view.findViewById(R.id.tilPassword); @@ -244,7 +245,6 @@ public class FragmentIdentity extends FragmentBase { cbUnicode = view.findViewById(R.id.cbUnicode); cbOctetMime = view.findViewById(R.id.cbOctetMime); etMaxSize = view.findViewById(R.id.etMaxSize); - cbDane = view.findViewById(R.id.cbDane); btnSave = view.findViewById(R.id.btnSave); pbSave = view.findViewById(R.id.pbSave); @@ -1291,6 +1291,8 @@ public class FragmentIdentity extends FragmentBase { rgEncryption.check(R.id.radio_ssl); cbInsecure.setChecked(identity == null ? false : identity.insecure); + cbDane.setChecked(identity == null ? false : identity.dane); + cbDane.setEnabled(!cbInsecure.isChecked()); etPort.setText(identity == null ? null : Long.toString(identity.port)); etUser.setText(identity == null ? null : identity.user); tilPassword.getEditText().setText(identity == null ? null : identity.password); @@ -1331,8 +1333,6 @@ public class FragmentIdentity extends FragmentBase { cbEncryptDefault.setChecked(identity != null && identity.encrypt_default); cbUnicode.setChecked(identity != null && identity.unicode); cbOctetMime.setChecked(identity != null && identity.octetmime); - cbDane.setChecked(identity == null ? false : identity.dane); - cbDane.setEnabled(!cbInsecure.isChecked()); auth = (identity == null ? AUTH_TYPE_PASSWORD : identity.auth_type); provider = (identity == null ? null : identity.provider); diff --git a/app/src/main/java/eu/faircode/email/FragmentPop.java b/app/src/main/java/eu/faircode/email/FragmentPop.java index 779b2b5782..95624350cd 100644 --- a/app/src/main/java/eu/faircode/email/FragmentPop.java +++ b/app/src/main/java/eu/faircode/email/FragmentPop.java @@ -76,6 +76,7 @@ public class FragmentPop extends FragmentBase { private RadioGroup rgEncryption; private CheckBox cbInsecure; private TextView tvInsecureRemark; + private CheckBox cbDane; private EditText etPort; private EditText etUser; private TextInputLayout tilPassword; @@ -107,7 +108,6 @@ public class FragmentPop extends FragmentBase { private EditText etInterval; private CheckBox cbUnmetered; private CheckBox cbVpnOnly; - private CheckBox cbDane; private ArrayAdapter adapterSwipe; private Spinner spLeft; @@ -157,6 +157,7 @@ public class FragmentPop extends FragmentBase { rgEncryption = view.findViewById(R.id.rgEncryption); cbInsecure = view.findViewById(R.id.cbInsecure); tvInsecureRemark = view.findViewById(R.id.tvInsecureRemark); + cbDane = view.findViewById(R.id.cbDane); etUser = view.findViewById(R.id.etUser); tilPassword = view.findViewById(R.id.tilPassword); tvPasswordStorage = view.findViewById(R.id.tvPasswordStorage); @@ -186,7 +187,6 @@ public class FragmentPop extends FragmentBase { etInterval = view.findViewById(R.id.etInterval); cbUnmetered = view.findViewById(R.id.cbUnmeteredOnly); cbVpnOnly = view.findViewById(R.id.cbVpnOnly); - cbDane = view.findViewById(R.id.cbDane); spLeft = view.findViewById(R.id.spLeft); spRight = view.findViewById(R.id.spRight); @@ -848,6 +848,8 @@ public class FragmentPop extends FragmentBase { rgEncryption.check(R.id.radio_ssl); cbInsecure.setChecked(account == null ? false : account.insecure); + cbDane.setChecked(account == null ? false : account.dane); + cbDane.setEnabled(!cbInsecure.isChecked()); etUser.setText(account == null ? null : account.user); tilPassword.getEditText().setText(account == null ? null : account.password); @@ -880,8 +882,6 @@ public class FragmentPop extends FragmentBase { etInterval.setText(account == null ? "" : Long.toString(account.poll_interval)); cbUnmetered.setChecked(jcondition.optBoolean("unmetered")); cbVpnOnly.setChecked(jcondition.optBoolean("vpn_only")); - cbDane.setChecked(account == null ? false : account.dane); - cbDane.setEnabled(!cbInsecure.isChecked()); cbIdentity.setChecked(account == null); diff --git a/app/src/main/res/layout/fragment_account.xml b/app/src/main/res/layout/fragment_account.xml index 0c79e90c2c..d1bb8dbbfd 100644 --- a/app/src/main/res/layout/fragment_account.xml +++ b/app/src/main/res/layout/fragment_account.xml @@ -227,6 +227,29 @@ app:layout_constraintStart_toStartOf="parent" app:layout_constraintTop_toBottomOf="@id/cbInsecure" /> + + + + + app:layout_constraintTop_toBottomOf="@id/tvDaneRemark" /> - - - -