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
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 />

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

@ -50,7 +50,6 @@ public class FragmentOptionsMisc extends FragmentBase implements SharedPreferenc
private TextView tvSubscriptionPro;
private SwitchCompat swSubscribedOnly;
private SwitchCompat swEnglish;
private SwitchCompat swAuthentication;
private SwitchCompat swWatchdog;
private SwitchCompat swUpdates;
private SwitchCompat swCrashReports;
@ -64,7 +63,7 @@ public class FragmentOptionsMisc extends FragmentBase implements SharedPreferenc
private Group grpDebug;
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[]{
@ -86,7 +85,6 @@ public class FragmentOptionsMisc extends FragmentBase implements SharedPreferenc
tvSubscriptionPro = view.findViewById(R.id.tvSubscriptionPro);
swSubscribedOnly = view.findViewById(R.id.swSubscribedOnly);
swEnglish = view.findViewById(R.id.swEnglish);
swAuthentication = view.findViewById(R.id.swAuthentication);
swWatchdog = view.findViewById(R.id.swWatchdog);
swUpdates = view.findViewById(R.id.swUpdates);
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() {
@Override
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));
swEnglish.setChecked(prefs.getBoolean("english", false));
swAuthentication.setChecked(prefs.getBoolean("authentication", true));
swWatchdog.setChecked(prefs.getBoolean("watchdog", true));
swUpdates.setChecked(prefs.getBoolean("updates", true));
swUpdates.setVisibility(Helper.isPlayStoreInstall(getContext()) ? View.GONE : View.VISIBLE);

@ -158,6 +158,30 @@
app:layout_constraintTop_toBottomOf="@id/swAutoRead"
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
android:id="@+id/swDisableTracking"
android:layout_width="match_parent"
@ -166,7 +190,7 @@
android:checked="true"
android:text="@string/title_advanced_tracking"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/swAutoMove"
app:layout_constraintTop_toBottomOf="@id/swAuthentication"
app:switchPadding="12dp" />
</androidx.constraintlayout.widget.ConstraintLayout>
</ScrollView>

@ -107,29 +107,6 @@
app:layout_constraintStart_toStartOf="parent"
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
android:id="@+id/swWatchdog"
android:layout_width="match_parent"
@ -138,7 +115,7 @@
android:checked="true"
android:text="@string/title_advanced_watchdog"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/swAuthentication"
app:layout_constraintTop_toBottomOf="@id/tvEnglishHint"
app:switchPadding="12dp" />
<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_autoread">Automatically mark messages read on 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_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_sync_subscribed">Synchronize subscribed folders only</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_updates">Check for updates</string>
<string name="title_advanced_crash_reports">Send error reports</string>

Loading…
Cancel
Save