Added setting to enable/disable conversation threading

This commit is contained in:
M66B
2018-11-29 09:51:22 +01:00
parent 15b9351cd8
commit b5b0e56fea
10 changed files with 51 additions and 18 deletions

View File

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