Moved authentication setting to behavior

pull/157/head
M66B 5 years ago
parent ed0a57f707
commit 7f867220b0

@ -1626,7 +1626,7 @@ and [SPF](https://en.wikipedia.org/wiki/Sender_Policy_Framework) authorization i
However, FairEmail will show a small warning flag However, FairEmail will show a small warning flag
when DKIM, SPF or [DMARC](https://en.wikipedia.org/wiki/DMARC) authentication failed on the receiving server. when DKIM, SPF or [DMARC](https://en.wikipedia.org/wiki/DMARC) authentication failed on the receiving server.
You can enable/disable this in the miscellaneous settings. You can enable/disable this in the behavior settings.
<br /> <br />

@ -45,11 +45,12 @@ public class FragmentOptionsBehavior extends FragmentBase implements SharedPrefe
private SwitchCompat swCollapse; private SwitchCompat swCollapse;
private SwitchCompat swAutoRead; private SwitchCompat swAutoRead;
private SwitchCompat swAutoMove; private SwitchCompat swAutoMove;
private SwitchCompat swAuthentication;
private SwitchCompat swDisableTracking; private SwitchCompat swDisableTracking;
private final static String[] RESET_OPTIONS = new String[]{ private final static String[] RESET_OPTIONS = new String[]{
"pull", "autoscroll", "swipenav", "doubletap", "autoexpand", "autoclose", "autonext", "pull", "autoscroll", "swipenav", "doubletap", "autoexpand", "autoclose", "autonext",
"collapse", "autoread", "automove", "disable_tracking" "collapse", "autoread", "automove", "authentication", "disable_tracking"
}; };
@Override @Override
@ -72,6 +73,7 @@ public class FragmentOptionsBehavior extends FragmentBase implements SharedPrefe
swCollapse = view.findViewById(R.id.swCollapse); swCollapse = view.findViewById(R.id.swCollapse);
swAutoRead = view.findViewById(R.id.swAutoRead); swAutoRead = view.findViewById(R.id.swAutoRead);
swAutoMove = view.findViewById(R.id.swAutoMove); swAutoMove = view.findViewById(R.id.swAutoMove);
swAuthentication = view.findViewById(R.id.swAuthentication);
swDisableTracking = view.findViewById(R.id.swDisableTracking); swDisableTracking = view.findViewById(R.id.swDisableTracking);
setOptions(); setOptions();
@ -151,6 +153,13 @@ public class FragmentOptionsBehavior extends FragmentBase implements SharedPrefe
} }
}); });
swAuthentication.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
@Override
public void onCheckedChanged(CompoundButton compoundButton, boolean checked) {
prefs.edit().putBoolean("authentication", checked).apply();
}
});
swDisableTracking.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() { swDisableTracking.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
@Override @Override
public void onCheckedChanged(CompoundButton compoundButton, boolean checked) { public void onCheckedChanged(CompoundButton compoundButton, boolean checked) {
@ -213,6 +222,7 @@ public class FragmentOptionsBehavior extends FragmentBase implements SharedPrefe
swCollapse.setChecked(prefs.getBoolean("collapse", false)); swCollapse.setChecked(prefs.getBoolean("collapse", false));
swAutoRead.setChecked(prefs.getBoolean("autoread", false)); swAutoRead.setChecked(prefs.getBoolean("autoread", false));
swAutoMove.setChecked(!prefs.getBoolean("automove", false)); swAutoMove.setChecked(!prefs.getBoolean("automove", false));
swAuthentication.setChecked(prefs.getBoolean("authentication", true));
swDisableTracking.setChecked(prefs.getBoolean("disable_tracking", true)); swDisableTracking.setChecked(prefs.getBoolean("disable_tracking", true));
} }
} }

@ -50,7 +50,6 @@ public class FragmentOptionsMisc extends FragmentBase implements SharedPreferenc
private TextView tvSubscriptionPro; private TextView tvSubscriptionPro;
private SwitchCompat swSubscribedOnly; private SwitchCompat swSubscribedOnly;
private SwitchCompat swEnglish; private SwitchCompat swEnglish;
private SwitchCompat swAuthentication;
private SwitchCompat swWatchdog; private SwitchCompat swWatchdog;
private SwitchCompat swUpdates; private SwitchCompat swUpdates;
private SwitchCompat swCrashReports; private SwitchCompat swCrashReports;
@ -64,7 +63,7 @@ public class FragmentOptionsMisc extends FragmentBase implements SharedPreferenc
private Group grpDebug; private Group grpDebug;
private final static String[] RESET_OPTIONS = new String[]{ private final static String[] RESET_OPTIONS = new String[]{
"badge", "subscriptions", "subscribed_only", "english", "authentication", "watchdog", "updates", "crash_reports", "debug" "badge", "subscriptions", "subscribed_only", "english", "watchdog", "updates", "crash_reports", "debug"
}; };
private final static String[] RESET_QUESTIONS = new String[]{ private final static String[] RESET_QUESTIONS = new String[]{
@ -86,7 +85,6 @@ public class FragmentOptionsMisc extends FragmentBase implements SharedPreferenc
tvSubscriptionPro = view.findViewById(R.id.tvSubscriptionPro); tvSubscriptionPro = view.findViewById(R.id.tvSubscriptionPro);
swSubscribedOnly = view.findViewById(R.id.swSubscribedOnly); swSubscribedOnly = view.findViewById(R.id.swSubscribedOnly);
swEnglish = view.findViewById(R.id.swEnglish); swEnglish = view.findViewById(R.id.swEnglish);
swAuthentication = view.findViewById(R.id.swAuthentication);
swWatchdog = view.findViewById(R.id.swWatchdog); swWatchdog = view.findViewById(R.id.swWatchdog);
swUpdates = view.findViewById(R.id.swUpdates); swUpdates = view.findViewById(R.id.swUpdates);
swCrashReports = view.findViewById(R.id.swCrashReports); swCrashReports = view.findViewById(R.id.swCrashReports);
@ -138,13 +136,6 @@ public class FragmentOptionsMisc extends FragmentBase implements SharedPreferenc
} }
}); });
swAuthentication.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
@Override
public void onCheckedChanged(CompoundButton compoundButton, boolean checked) {
prefs.edit().putBoolean("authentication", checked).apply();
}
});
swWatchdog.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() { swWatchdog.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
@Override @Override
public void onCheckedChanged(CompoundButton compoundButton, boolean checked) { public void onCheckedChanged(CompoundButton compoundButton, boolean checked) {
@ -243,7 +234,6 @@ public class FragmentOptionsMisc extends FragmentBase implements SharedPreferenc
swSubscribedOnly.setChecked(prefs.getBoolean("subscribed_only", false)); swSubscribedOnly.setChecked(prefs.getBoolean("subscribed_only", false));
swEnglish.setChecked(prefs.getBoolean("english", false)); swEnglish.setChecked(prefs.getBoolean("english", false));
swAuthentication.setChecked(prefs.getBoolean("authentication", true));
swWatchdog.setChecked(prefs.getBoolean("watchdog", true)); swWatchdog.setChecked(prefs.getBoolean("watchdog", true));
swUpdates.setChecked(prefs.getBoolean("updates", true)); swUpdates.setChecked(prefs.getBoolean("updates", true));
swUpdates.setVisibility(Helper.isPlayStoreInstall(getContext()) ? View.GONE : View.VISIBLE); swUpdates.setVisibility(Helper.isPlayStoreInstall(getContext()) ? View.GONE : View.VISIBLE);

@ -158,6 +158,30 @@
app:layout_constraintTop_toBottomOf="@id/swAutoRead" app:layout_constraintTop_toBottomOf="@id/swAutoRead"
app:switchPadding="12dp" /> app:switchPadding="12dp" />
<ImageView
android:id="@+id/ivAuth"
android:layout_width="21dp"
android:layout_height="21dp"
android:contentDescription="@string/title_legend_auth"
android:src="@drawable/baseline_flag_24"
android:tint="@color/colorError"
app:layout_constraintBottom_toBottomOf="@+id/swAuthentication"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="@+id/swAuthentication" />
<androidx.appcompat.widget.SwitchCompat
android:id="@+id/swAuthentication"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="6dp"
android:layout_marginTop="12dp"
android:checked="true"
android:text="@string/title_advanced_authentication"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toEndOf="@id/ivAuth"
app:layout_constraintTop_toBottomOf="@id/swAutoMove"
app:switchPadding="12dp" />
<androidx.appcompat.widget.SwitchCompat <androidx.appcompat.widget.SwitchCompat
android:id="@+id/swDisableTracking" android:id="@+id/swDisableTracking"
android:layout_width="match_parent" android:layout_width="match_parent"
@ -166,7 +190,7 @@
android:checked="true" android:checked="true"
android:text="@string/title_advanced_tracking" android:text="@string/title_advanced_tracking"
app:layout_constraintStart_toStartOf="parent" app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/swAutoMove" app:layout_constraintTop_toBottomOf="@id/swAuthentication"
app:switchPadding="12dp" /> app:switchPadding="12dp" />
</androidx.constraintlayout.widget.ConstraintLayout> </androidx.constraintlayout.widget.ConstraintLayout>
</ScrollView> </ScrollView>

@ -107,29 +107,6 @@
app:layout_constraintStart_toStartOf="parent" app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/swEnglish" /> app:layout_constraintTop_toBottomOf="@id/swEnglish" />
<ImageView
android:id="@+id/ivAuth"
android:layout_width="21dp"
android:layout_height="21dp"
android:contentDescription="@string/title_legend_auth"
android:src="@drawable/baseline_flag_24"
android:tint="@color/colorError"
app:layout_constraintBottom_toBottomOf="@+id/swAuthentication"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="@+id/swAuthentication" />
<androidx.appcompat.widget.SwitchCompat
android:id="@+id/swAuthentication"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="6dp"
android:layout_marginTop="12dp"
android:text="@string/title_advanced_authentication"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toEndOf="@id/ivAuth"
app:layout_constraintTop_toBottomOf="@id/tvEnglishHint"
app:switchPadding="12dp" />
<androidx.appcompat.widget.SwitchCompat <androidx.appcompat.widget.SwitchCompat
android:id="@+id/swWatchdog" android:id="@+id/swWatchdog"
android:layout_width="match_parent" android:layout_width="match_parent"
@ -138,7 +115,7 @@
android:checked="true" android:checked="true"
android:text="@string/title_advanced_watchdog" android:text="@string/title_advanced_watchdog"
app:layout_constraintStart_toStartOf="parent" app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/swAuthentication" app:layout_constraintTop_toBottomOf="@id/tvEnglishHint"
app:switchPadding="12dp" /> app:switchPadding="12dp" />
<androidx.appcompat.widget.SwitchCompat <androidx.appcompat.widget.SwitchCompat

@ -224,6 +224,7 @@
<string name="title_advanced_autonext">Automatically go to next conversation on close conversation</string> <string name="title_advanced_autonext">Automatically go to next conversation on close conversation</string>
<string name="title_advanced_autoread">Automatically mark messages read on moving messages</string> <string name="title_advanced_autoread">Automatically mark messages read on moving messages</string>
<string name="title_advanced_automove">Confirm moving messages</string> <string name="title_advanced_automove">Confirm moving messages</string>
<string name="title_advanced_authentication">Show a warning when the receiving server could not authenticate the message</string>
<string name="title_advanced_tracking">Automatically recognize and disable tracking images</string> <string name="title_advanced_tracking">Automatically recognize and disable tracking images</string>
<string name="title_advanced_notify_preview">Show message preview in notifications</string> <string name="title_advanced_notify_preview">Show message preview in notifications</string>
@ -242,7 +243,6 @@
<string name="title_advanced_subscriptions">Manage folder subscriptions</string> <string name="title_advanced_subscriptions">Manage folder subscriptions</string>
<string name="title_advanced_sync_subscribed">Synchronize subscribed folders only</string> <string name="title_advanced_sync_subscribed">Synchronize subscribed folders only</string>
<string name="title_advanced_english">Force English language</string> <string name="title_advanced_english">Force English language</string>
<string name="title_advanced_authentication">Show a warning when the receiving server could not authenticate the message</string>
<string name="title_advanced_watchdog">Periodically check if FairEmail is still active</string> <string name="title_advanced_watchdog">Periodically check if FairEmail is still active</string>
<string name="title_advanced_updates">Check for updates</string> <string name="title_advanced_updates">Check for updates</string>
<string name="title_advanced_crash_reports">Send error reports</string> <string name="title_advanced_crash_reports">Send error reports</string>

Loading…
Cancel
Save