Moved PDF preview option

This commit is contained in:
M66B
2023-10-19 08:20:55 +02:00
parent a348bc4d99
commit 1be4d55942
5 changed files with 28 additions and 25 deletions

View File

@@ -181,6 +181,7 @@ public class FragmentOptionsDisplay extends FragmentBase implements SharedPrefer
private TextView tvUnzipHint;
private SwitchCompat swAttachmentsAlt;
private SwitchCompat swThumbnails;
private SwitchCompat swPdfPreview;
private SwitchCompat swListCount;
private SwitchCompat swBundledFonts;
@@ -220,7 +221,7 @@ public class FragmentOptionsDisplay extends FragmentBase implements SharedPrefer
"hyphenation", "display_font", "contrast", "monospaced_pre",
"text_separators",
"collapse_quotes", "image_placeholders", "inline_images", "button_extra",
"unzip", "attachments_alt", "thumbnails",
"unzip", "attachments_alt", "thumbnails", "pdf_preview",
"list_count", "bundled_fonts", "narrow_fonts", "parse_classes",
"background_color", "text_color", "text_size", "text_font", "text_align", "text_titles",
"authentication", "authentication_indicator"
@@ -351,6 +352,7 @@ public class FragmentOptionsDisplay extends FragmentBase implements SharedPrefer
tvUnzipHint = view.findViewById(R.id.tvUnzipHint);
swAttachmentsAlt = view.findViewById(R.id.swAttachmentsAlt);
swThumbnails = view.findViewById(R.id.swThumbnails);
swPdfPreview = view.findViewById(R.id.swPdfPreview);
swListCount = view.findViewById(R.id.swListCount);
swBundledFonts = view.findViewById(R.id.swBundledFonts);
@@ -1304,6 +1306,14 @@ public class FragmentOptionsDisplay extends FragmentBase implements SharedPrefer
@Override
public void onCheckedChanged(CompoundButton compoundButton, boolean checked) {
prefs.edit().putBoolean("thumbnails", checked).apply();
swPdfPreview.setEnabled(checked);
}
});
swPdfPreview.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
@Override
public void onCheckedChanged(CompoundButton compoundButton, boolean checked) {
prefs.edit().putBoolean("pdf_preview", checked).apply();
}
});
@@ -1644,6 +1654,8 @@ public class FragmentOptionsDisplay extends FragmentBase implements SharedPrefer
swUnzip.setChecked(prefs.getBoolean("unzip", !BuildConfig.PLAY_STORE_RELEASE));
swAttachmentsAlt.setChecked(prefs.getBoolean("attachments_alt", false));
swThumbnails.setChecked(prefs.getBoolean("thumbnails", true));
swPdfPreview.setChecked(prefs.getBoolean("pdf_preview", true));
swPdfPreview.setEnabled(swThumbnails.isChecked());
swListCount.setChecked(prefs.getBoolean("list_count", false));
swBundledFonts.setChecked(prefs.getBoolean("bundled_fonts", true));