Added option to disable image placeholders

This commit is contained in:
M66B
2020-11-16 09:45:21 +01:00
parent ef2f2ca99e
commit 3e9b60d433
5 changed files with 52 additions and 8 deletions

View File

@@ -126,6 +126,7 @@ public class FragmentOptionsDisplay extends FragmentBase implements SharedPrefer
private SwitchCompat swTextAlign;
private SwitchCompat swTextSeparators;
private SwitchCompat swCollapseQuotes;
private SwitchCompat swImagesPlaceholders;
private SwitchCompat swImagesInline;
private SwitchCompat swAttachmentsAlt;
private SwitchCompat swThumbnails;
@@ -145,7 +146,7 @@ public class FragmentOptionsDisplay extends FragmentBase implements SharedPrefer
"addresses",
"message_zoom", "overview_mode", "contrast", "monospaced", "monospaced_pre",
"text_color", "text_size", "text_font", "text_align", "text_separators",
"inline_images", "collapse_quotes", "attachments_alt", "thumbnails",
"collapse_quotes", "image_placeholders", "inline_images", "attachments_alt", "thumbnails",
"parse_classes", "authentication"
};
@@ -221,6 +222,7 @@ public class FragmentOptionsDisplay extends FragmentBase implements SharedPrefer
swTextAlign = view.findViewById(R.id.swTextAlign);
swTextSeparators = view.findViewById(R.id.swTextSeparators);
swCollapseQuotes = view.findViewById(R.id.swCollapseQuotes);
swImagesPlaceholders = view.findViewById(R.id.swImagesPlaceholders);
swImagesInline = view.findViewById(R.id.swImagesInline);
swAttachmentsAlt = view.findViewById(R.id.swAttachmentsAlt);
swThumbnails = view.findViewById(R.id.swThumbnails);
@@ -770,6 +772,13 @@ public class FragmentOptionsDisplay extends FragmentBase implements SharedPrefer
}
});
swImagesPlaceholders.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
@Override
public void onCheckedChanged(CompoundButton compoundButton, boolean checked) {
prefs.edit().putBoolean("image_placeholders", checked).apply();
}
});
swImagesInline.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
@Override
public void onCheckedChanged(CompoundButton compoundButton, boolean checked) {
@@ -968,6 +977,7 @@ public class FragmentOptionsDisplay extends FragmentBase implements SharedPrefer
swTextAlign.setChecked(prefs.getBoolean("text_align", true));
swTextSeparators.setChecked(prefs.getBoolean("text_separators", false));
swCollapseQuotes.setChecked(prefs.getBoolean("collapse_quotes", false));
swImagesPlaceholders.setChecked(prefs.getBoolean("image_placeholders", true));
swImagesInline.setChecked(prefs.getBoolean("inline_images", false));
swAttachmentsAlt.setChecked(prefs.getBoolean("attachments_alt", false));
swThumbnails.setChecked(prefs.getBoolean("thumbnails", true));