Added option to show inline images by default

This commit is contained in:
M66B
2019-07-02 10:54:09 +02:00
parent b4a8bc1568
commit 25a19ad0c1
5 changed files with 50 additions and 5 deletions

View File

@@ -55,12 +55,13 @@ public class FragmentOptionsDisplay extends FragmentBase implements SharedPrefer
private SwitchCompat swAddresses;
private SwitchCompat swAttachmentsAlt;
private SwitchCompat swMonospaced;
private SwitchCompat swInline;
private SwitchCompat swImages;
private SwitchCompat swActionbar;
private final static String[] RESET_OPTIONS = new String[]{
"theme", "startup", "date", "threading", "avatars", "identicons", "circular", "name_email", "subject_italic",
"flags", "preview", "addresses", "attachments_alt", "monospaced", "autoimages", "actionbar",
"flags", "preview", "addresses", "attachments_alt", "monospaced", "inline_images", "autoimages", "actionbar",
};
@Override
@@ -87,6 +88,7 @@ public class FragmentOptionsDisplay extends FragmentBase implements SharedPrefer
swAddresses = view.findViewById(R.id.swAddresses);
swAttachmentsAlt = view.findViewById(R.id.swAttachmentsAlt);
swMonospaced = view.findViewById(R.id.swMonospaced);
swInline = view.findViewById(R.id.swInline);
swImages = view.findViewById(R.id.swImages);
swActionbar = view.findViewById(R.id.swActionbar);
@@ -203,6 +205,13 @@ public class FragmentOptionsDisplay extends FragmentBase implements SharedPrefer
}
});
swInline.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
@Override
public void onCheckedChanged(CompoundButton compoundButton, boolean checked) {
prefs.edit().putBoolean("inline_images", checked).apply();
}
});
swImages.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
@Override
public void onCheckedChanged(CompoundButton compoundButton, boolean checked) {
@@ -283,6 +292,7 @@ public class FragmentOptionsDisplay extends FragmentBase implements SharedPrefer
swAddresses.setChecked(prefs.getBoolean("addresses", false));
swAttachmentsAlt.setChecked(prefs.getBoolean("attachments_alt", false));
swMonospaced.setChecked(prefs.getBoolean("monospaced", false));
swInline.setChecked(prefs.getBoolean("inline_images", false));
swImages.setChecked(prefs.getBoolean("autoimages", false));
swActionbar.setChecked(prefs.getBoolean("actionbar", true));
}