Added optiont to disabling printing of block quotes

pull/214/head
M66B 11 months ago
parent 08a7011335
commit f3d13efc90

@ -77,6 +77,7 @@ public class FragmentDialogPrint extends FragmentDialogBase {
View dview = LayoutInflater.from(context).inflate(R.layout.dialog_print, null);
CheckBox cbHeader = dview.findViewById(R.id.cbHeader);
CheckBox cbImages = dview.findViewById(R.id.cbImages);
CheckBox cbBlockQuotes = dview.findViewById(R.id.cbBlockQuotes);
CheckBox cbNotAgain = dview.findViewById(R.id.cbNotAgain);
cbHeader.setChecked(prefs.getBoolean("print_html_header", true));
@ -95,6 +96,14 @@ public class FragmentDialogPrint extends FragmentDialogBase {
}
});
cbBlockQuotes.setChecked(prefs.getBoolean("print_html_block_quotes", true));
cbBlockQuotes.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
@Override
public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
prefs.edit().putBoolean("print_html_block_quotes", isChecked).apply();
}
});
cbNotAgain.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
@Override
public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
@ -128,9 +137,11 @@ public class FragmentDialogPrint extends FragmentDialogBase {
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(activity);
boolean print_html_header = prefs.getBoolean("print_html_header", true);
boolean print_html_images = prefs.getBoolean("print_html_images", true);
boolean print_html_block_quotes = prefs.getBoolean("print_html_block_quotes", true);
args.putBoolean("print_html_header", print_html_header);
args.putBoolean("print_html_images", print_html_images);
args.putBoolean("print_html_block_quotes", print_html_block_quotes);
new SimpleTask<String[]>() {
@Override
@ -139,6 +150,7 @@ public class FragmentDialogPrint extends FragmentDialogBase {
boolean headers = args.getBoolean("headers");
boolean print_html_header = args.getBoolean("print_html_header");
boolean print_html_images = args.getBoolean("print_html_images");
boolean print_html_block_quotes = args.getBoolean("print_html_block_quotes");
CharSequence selected = args.getCharSequence("selected");
boolean draft = args.getBoolean("draft");
@ -172,6 +184,15 @@ public class FragmentDialogPrint extends FragmentDialogBase {
if (message.isPlainOnly() && monospaced_pre)
HtmlHelper.restorePre(document);
if (!print_html_block_quotes)
for (Element bq : document.select("blockquote")) {
String style = bq.attr("style");
bq.attr("style", HtmlHelper.mergeStyles(style,
"border: none !important;" +
"margin-left: 0; margin-right: 0;" +
"padding-left: 0; padding-right: 0;"));
}
HtmlHelper.markText(document);
HtmlHelper.embedInlineImages(context, id, document, true);

@ -323,7 +323,7 @@ public class FragmentOptionsMisc extends FragmentBase implements SharedPreferenc
"crash_reports_asked", "review_asked", "review_later", "why",
"reply_hint", "html_always_images", "open_full_confirmed", "open_amp_confirmed",
"ask_images", "ask_html",
"print_html_confirmed", "print_html_header", "print_html_images",
"print_html_confirmed", "print_html_header", "print_html_images", "print_html_block_quotes",
"reformatted_hint",
"selected_folders", "move_1_confirmed", "move_n_confirmed",
"last_search_senders", "last_search_recipients", "last_search_subject", "last_search_keywords", "last_search_message",

@ -38,6 +38,7 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="12dp"
android:checked="true"
android:text="@string/title_print_header"
android:textAppearance="@style/TextAppearance.AppCompat.Medium"
app:layout_constraintStart_toStartOf="parent"
@ -48,6 +49,7 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="12dp"
android:checked="true"
android:text="@string/title_print_images"
android:textAppearance="@style/TextAppearance.AppCompat.Medium"
app:layout_constraintStart_toStartOf="parent"
@ -64,6 +66,17 @@
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/cbImages" />
<CheckBox
android:id="@+id/cbBlockQuotes"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="12dp"
android:checked="true"
android:text="@string/title_print_block_quotes"
android:textAppearance="@style/TextAppearance.AppCompat.Medium"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/tvImagesRemark" />
<CheckBox
android:id="@+id/cbNotAgain"
android:layout_width="wrap_content"
@ -72,6 +85,6 @@
android:text="@string/title_no_ask_again"
android:textAppearance="@style/TextAppearance.AppCompat.Small"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/tvImagesRemark" />
app:layout_constraintTop_toBottomOf="@id/cbBlockQuotes" />
</androidx.constraintlayout.widget.ConstraintLayout>
</eu.faircode.email.ScrollViewEx>

@ -1420,6 +1420,7 @@
<string name="title_print_header">Print header</string>
<string name="title_print_images">Print images</string>
<string name="title_print_images_remark">Downloading images might take some time</string>
<string name="title_print_block_quotes">Print block quotes</string>
<string name="title_show_headers">Show headers</string>
<string name="title_share_as_html">Share as HTML</string>
<string name="title_raw_save">Save raw message</string>

Loading…
Cancel
Save