Added setting to enable/disabled unified inbox

This commit is contained in:
M66B
2018-12-02 10:09:21 +01:00
parent 4fe9be72b5
commit a941094216
10 changed files with 95 additions and 49 deletions

View File

@@ -43,6 +43,7 @@ import androidx.appcompat.widget.SwitchCompat;
public class FragmentOptions extends FragmentEx implements SharedPreferences.OnSharedPreferenceChangeListener {
private SwitchCompat swEnabled;
private SwitchCompat swMetered;
private SwitchCompat swUnified;
private SwitchCompat swThreading;
private SwitchCompat swCompact;
private SwitchCompat swAvatars;
@@ -70,6 +71,7 @@ public class FragmentOptions extends FragmentEx implements SharedPreferences.OnS
// Get controls
swEnabled = view.findViewById(R.id.swEnabled);
swMetered = view.findViewById(R.id.swMetered);
swUnified = view.findViewById(R.id.swUnified);
swThreading = view.findViewById(R.id.swThreading);
swCompact = view.findViewById(R.id.swCompact);
swAvatars = view.findViewById(R.id.swAvatars);
@@ -109,6 +111,14 @@ public class FragmentOptions extends FragmentEx implements SharedPreferences.OnS
}
});
swUnified.setChecked(prefs.getBoolean("unified", true));
swUnified.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
@Override
public void onCheckedChanged(CompoundButton compoundButton, boolean checked) {
prefs.edit().putBoolean("unified", checked).apply();
}
});
swThreading.setChecked(prefs.getBoolean("threading", true));
swThreading.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
@Override