Added option to enable/disable DMARC viewer

pull/213/head
M66B 1 year ago
parent 5be2874179
commit 7afa991080

@ -243,6 +243,7 @@ public class FragmentOptionsMisc extends FragmentBase implements SharedPreferenc
private SwitchCompat swMdn; private SwitchCompat swMdn;
private SwitchCompat swAppChooser; private SwitchCompat swAppChooser;
private SwitchCompat swDeleteConfirmation; private SwitchCompat swDeleteConfirmation;
private SwitchCompat swDmarcViewer;
private EditText etKeywords; private EditText etKeywords;
private SwitchCompat swTestIab; private SwitchCompat swTestIab;
private Button btnImportProviders; private Button btnImportProviders;
@ -497,6 +498,7 @@ public class FragmentOptionsMisc extends FragmentBase implements SharedPreferenc
swMdn = view.findViewById(R.id.swMdn); swMdn = view.findViewById(R.id.swMdn);
swAppChooser = view.findViewById(R.id.swAppChooser); swAppChooser = view.findViewById(R.id.swAppChooser);
swDeleteConfirmation = view.findViewById(R.id.swDeleteConfirmation); swDeleteConfirmation = view.findViewById(R.id.swDeleteConfirmation);
swDmarcViewer = view.findViewById(R.id.swDmarcViewer);
etKeywords = view.findViewById(R.id.etKeywords); etKeywords = view.findViewById(R.id.etKeywords);
swTestIab = view.findViewById(R.id.swTestIab); swTestIab = view.findViewById(R.id.swTestIab);
btnImportProviders = view.findViewById(R.id.btnImportProviders); btnImportProviders = view.findViewById(R.id.btnImportProviders);
@ -1889,6 +1891,13 @@ public class FragmentOptionsMisc extends FragmentBase implements SharedPreferenc
} }
}); });
swDmarcViewer.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
@Override
public void onCheckedChanged(CompoundButton compoundButton, boolean checked) {
Helper.enableComponent(compoundButton.getContext(), ActivityDmarc.class, checked);
}
});
etKeywords.addTextChangedListener(new TextWatcher() { etKeywords.addTextChangedListener(new TextWatcher() {
@Override @Override
public void beforeTextChanged(CharSequence s, int start, int count, int after) { public void beforeTextChanged(CharSequence s, int start, int count, int after) {
@ -2642,6 +2651,7 @@ public class FragmentOptionsMisc extends FragmentBase implements SharedPreferenc
swMdn.setChecked(prefs.getBoolean("mdn", swExperiments.isChecked())); swMdn.setChecked(prefs.getBoolean("mdn", swExperiments.isChecked()));
swAppChooser.setChecked(prefs.getBoolean("app_chooser", false)); swAppChooser.setChecked(prefs.getBoolean("app_chooser", false));
swDeleteConfirmation.setChecked(prefs.getBoolean("delete_confirmation", true)); swDeleteConfirmation.setChecked(prefs.getBoolean("delete_confirmation", true));
swDmarcViewer.setChecked(Helper.isComponentEnabled(getContext(), ActivityDmarc.class));
etKeywords.setText(prefs.getString("global_keywords", null)); etKeywords.setText(prefs.getString("global_keywords", null));
swTestIab.setChecked(prefs.getBoolean("test_iab", false)); swTestIab.setChecked(prefs.getBoolean("test_iab", false));

@ -2332,6 +2332,17 @@
app:layout_constraintStart_toStartOf="parent" app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/swDeleteConfirmation" /> app:layout_constraintTop_toBottomOf="@id/swDeleteConfirmation" />
<androidx.appcompat.widget.SwitchCompat
android:id="@+id/swDmarcViewer"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginTop="12dp"
android:text="@string/title_advanced_dmarc_viewer"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/tvDeleteConfirmationHint"
app:switchPadding="12dp" />
<EditText <EditText
android:id="@+id/etKeywords" android:id="@+id/etKeywords"
android:layout_width="0dp" android:layout_width="0dp"
@ -2342,7 +2353,7 @@
android:textAppearance="@style/TextAppearance.AppCompat.Small" android:textAppearance="@style/TextAppearance.AppCompat.Small"
app:layout_constraintEnd_toEndOf="parent" app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent" app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/tvDeleteConfirmationHint" /> app:layout_constraintTop_toBottomOf="@id/swDmarcViewer" />
<TextView <TextView
android:id="@+id/tvKeywordsHint" android:id="@+id/tvKeywordsHint"

@ -906,6 +906,7 @@
<string name="title_advanced_app_chooser" translatable="false">Use Android app chooser</string> <string name="title_advanced_app_chooser" translatable="false">Use Android app chooser</string>
<string name="title_advanced_delete_confirmation" translatable="false">Permanent deletion confirmation</string> <string name="title_advanced_delete_confirmation" translatable="false">Permanent deletion confirmation</string>
<string name="title_advanced_deletion_confirmation_hint" translatable="false">If you turn this off, please do not complain if you accidentally delete messages irreversibly</string> <string name="title_advanced_deletion_confirmation_hint" translatable="false">If you turn this off, please do not complain if you accidentally delete messages irreversibly</string>
<string name="title_advanced_dmarc_viewer" translatable="false">DMARC viewer</string>
<string name="title_advanced_global_keywords" translatable="false">Global keywords</string> <string name="title_advanced_global_keywords" translatable="false">Global keywords</string>
<string name="title_advanced_test_iab" translatable="false">Test IAB</string> <string name="title_advanced_test_iab" translatable="false">Test IAB</string>
<string name="title_advanced_import_providers" translatable="false">Import providers</string> <string name="title_advanced_import_providers" translatable="false">Import providers</string>

Loading…
Cancel
Save