Added sub option to show original messages/images by default

pull/215/head
M66B 7 months ago
parent be0630383b
commit 1c8f257c10

@ -5588,6 +5588,7 @@ public class AdapterMessage extends RecyclerView.Adapter<AdapterMessage.ViewHold
CheckBox cbNotAgainSender = dview.findViewById(R.id.cbNotAgainSender); CheckBox cbNotAgainSender = dview.findViewById(R.id.cbNotAgainSender);
CheckBox cbNotAgainDomain = dview.findViewById(R.id.cbNotAgainDomain); CheckBox cbNotAgainDomain = dview.findViewById(R.id.cbNotAgainDomain);
CheckBox cbNotAgain = dview.findViewById(R.id.cbNotAgain); CheckBox cbNotAgain = dview.findViewById(R.id.cbNotAgain);
CheckBox cbNeverAgain = dview.findViewById(R.id.cbNeverAgain);
if (junk) { if (junk) {
if (full) if (full)
@ -5595,6 +5596,7 @@ public class AdapterMessage extends RecyclerView.Adapter<AdapterMessage.ViewHold
cbNotAgainSender.setVisibility(View.GONE); cbNotAgainSender.setVisibility(View.GONE);
cbNotAgainDomain.setVisibility(View.GONE); cbNotAgainDomain.setVisibility(View.GONE);
cbNotAgain.setVisibility(View.GONE); cbNotAgain.setVisibility(View.GONE);
cbNeverAgain.setVisibility(View.GONE);
} else if (senders == null || senders.length == 0) { } else if (senders == null || senders.length == 0) {
cbNotAgainSender.setVisibility(View.GONE); cbNotAgainSender.setVisibility(View.GONE);
cbNotAgainDomain.setVisibility(View.GONE); cbNotAgainDomain.setVisibility(View.GONE);
@ -5629,9 +5631,12 @@ public class AdapterMessage extends RecyclerView.Adapter<AdapterMessage.ViewHold
public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) { public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
cbNotAgainSender.setEnabled(!isChecked); cbNotAgainSender.setEnabled(!isChecked);
cbNotAgainDomain.setEnabled(!isChecked && cbNotAgainSender.isChecked()); cbNotAgainDomain.setEnabled(!isChecked && cbNotAgainSender.isChecked());
cbNeverAgain.setEnabled(isChecked);
} }
}); });
cbNeverAgain.setEnabled(false);
if (full) { if (full) {
TextView tvDark = dview.findViewById(R.id.tvDark); TextView tvDark = dview.findViewById(R.id.tvDark);
@ -5673,6 +5678,7 @@ public class AdapterMessage extends RecyclerView.Adapter<AdapterMessage.ViewHold
if (!junk) { if (!junk) {
SharedPreferences.Editor editor = prefs.edit(); SharedPreferences.Editor editor = prefs.edit();
if (senders != null) if (senders != null)
for (Address sender : senders) { for (Address sender : senders) {
String from = ((InternetAddress) sender).getAddress(); String from = ((InternetAddress) sender).getAddress();
@ -5685,7 +5691,12 @@ public class AdapterMessage extends RecyclerView.Adapter<AdapterMessage.ViewHold
editor.putBoolean(domain + (full ? ".show_full" : ".show_images"), editor.putBoolean(domain + (full ? ".show_full" : ".show_images"),
cbNotAgainSender.isChecked() && cbNotAgainDomain.isChecked()); cbNotAgainSender.isChecked() && cbNotAgainDomain.isChecked());
} }
editor.putBoolean(full ? "ask_html" : "ask_images", !cbNotAgain.isChecked()); editor.putBoolean(full ? "ask_html" : "ask_images", !cbNotAgain.isChecked());
if (cbNotAgain.isChecked())
editor.putBoolean(full ? "confirm_html" : "confirm_images", false);
editor.apply(); editor.apply();
} }

@ -72,5 +72,17 @@
android:textAppearance="@style/TextAppearance.AppCompat.Small" android:textAppearance="@style/TextAppearance.AppCompat.Small"
app:layout_constraintStart_toStartOf="parent" app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/cbNotAgainDomain" /> app:layout_constraintTop_toBottomOf="@id/cbNotAgainDomain" />
<CheckBox
android:id="@+id/cbNeverAgain"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="24dp"
android:layout_marginTop="12dp"
android:enabled="false"
android:text="@string/title_ask_show_html_always"
android:textAppearance="@style/TextAppearance.AppCompat.Small"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/cbNotAgain" />
</androidx.constraintlayout.widget.ConstraintLayout> </androidx.constraintlayout.widget.ConstraintLayout>
</ScrollView> </ScrollView>

@ -78,6 +78,18 @@
app:layout_constraintStart_toStartOf="parent" app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/cbNotAgainDomain" /> app:layout_constraintTop_toBottomOf="@id/cbNotAgainDomain" />
<CheckBox
android:id="@+id/cbNeverAgain"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="24dp"
android:layout_marginTop="12dp"
android:enabled="false"
android:text="@string/title_ask_show_images_always"
android:textAppearance="@style/TextAppearance.AppCompat.Small"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/cbNotAgain" />
<androidx.constraintlayout.widget.Group <androidx.constraintlayout.widget.Group
android:id="@+id/grpTracking" android:id="@+id/grpTracking"
android:layout_width="0dp" android:layout_width="0dp"

@ -1639,7 +1639,9 @@
<string name="title_ask_show_html">Showing the original message can leak privacy sensitive information</string> <string name="title_ask_show_html">Showing the original message can leak privacy sensitive information</string>
<string name="title_ask_show_html_remark">Displaying the original message on a dark background is not possible as it may make dark texts and images invisible</string> <string name="title_ask_show_html_remark">Displaying the original message on a dark background is not possible as it may make dark texts and images invisible</string>
<string name="title_ask_show_html_images">Always show images on showing original messages</string> <string name="title_ask_show_html_images">Always show images on showing original messages</string>
<string name="title_ask_show_html_always">Show original messages by default</string>
<string name="title_ask_show_image">Showing images can leak privacy sensitive information</string> <string name="title_ask_show_image">Showing images can leak privacy sensitive information</string>
<string name="title_ask_show_images_always">Show images by default</string>
<string name="title_ask_show_image_hint">Images recognized as tracking images will not be shown</string> <string name="title_ask_show_image_hint">Images recognized as tracking images will not be shown</string>
<string name="title_ask_show_amp">Show AMP variant of the message?</string> <string name="title_ask_show_amp">Show AMP variant of the message?</string>
<string name="title_ask_show_amp_hint">AMP messages are designed to be dynamic and to interact with the internet and can therefore by definition be used to track you</string> <string name="title_ask_show_amp_hint">AMP messages are designed to be dynamic and to interact with the internet and can therefore by definition be used to track you</string>

Loading…
Cancel
Save