Added setting to automatically show images for known contacts

This commit is contained in:
M66B
2019-01-27 17:30:15 +00:00
parent 0a84a6c6f8
commit 8c5d26643e
5 changed files with 48 additions and 24 deletions

View File

@@ -69,6 +69,7 @@ public class FragmentOptions extends FragmentBase implements SharedPreferences.O
private SwitchCompat swIdenticons;
private SwitchCompat swPreview;
private SwitchCompat swAddresses;
private SwitchCompat swImages;
private SwitchCompat swPull;
private SwitchCompat swActionbar;
@@ -90,7 +91,7 @@ public class FragmentOptions extends FragmentBase implements SharedPreferences.O
private Group grpNotification;
static String[] OPTIONS_RESTART = new String[]{
"unified", "date", "threading", "avatars", "identicons", "preview", "addresses",
"unified", "date", "threading", "avatars", "identicons", "preview", "addresses", "autoimages",
"pull", "actionbar", "autoclose", "autonext", "confirm", "debug"
};
@@ -129,6 +130,7 @@ public class FragmentOptions extends FragmentBase implements SharedPreferences.O
swIdenticons = view.findViewById(R.id.swIdenticons);
swPreview = view.findViewById(R.id.swPreview);
swAddresses = view.findViewById(R.id.swAddresses);
swImages = view.findViewById(R.id.swImages);
swPull = view.findViewById(R.id.swPull);
swActionbar = view.findViewById(R.id.swActionbar);
@@ -266,6 +268,13 @@ public class FragmentOptions extends FragmentBase implements SharedPreferences.O
}
});
swImages.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
@Override
public void onCheckedChanged(CompoundButton compoundButton, boolean checked) {
prefs.edit().putBoolean("autoimages", checked).apply();
}
});
swPull.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
@Override
public void onCheckedChanged(CompoundButton compoundButton, boolean checked) {
@@ -454,6 +463,7 @@ public class FragmentOptions extends FragmentBase implements SharedPreferences.O
swIdenticons.setChecked(prefs.getBoolean("identicons", false));
swPreview.setChecked(prefs.getBoolean("preview", false));
swAddresses.setChecked(prefs.getBoolean("addresses", true));
swImages.setChecked(prefs.getBoolean("autoimages", false));
swPull.setChecked(prefs.getBoolean("pull", true));
swActionbar.setChecked(prefs.getBoolean("actionbar", true));