Added section to collapse addresses section by default

This commit is contained in:
M66B
2019-01-09 14:51:18 +00:00
parent f893a11c8d
commit c99ebc751a
6 changed files with 31 additions and 5 deletions

View File

@@ -64,6 +64,7 @@ public class FragmentOptions extends FragmentEx implements SharedPreferences.OnS
private SwitchCompat swAvatars;
private SwitchCompat swIdenticons;
private SwitchCompat swPreview;
private SwitchCompat swAddresses;
private SwitchCompat swPull;
private SwitchCompat swSwipe;
@@ -104,6 +105,7 @@ public class FragmentOptions extends FragmentEx implements SharedPreferences.OnS
swAvatars = view.findViewById(R.id.swAvatars);
swIdenticons = view.findViewById(R.id.swIdenticons);
swPreview = view.findViewById(R.id.swPreview);
swAddresses = view.findViewById(R.id.swAddresses);
swPull = view.findViewById(R.id.swPull);
swSwipe = view.findViewById(R.id.swSwipe);
@@ -254,6 +256,14 @@ public class FragmentOptions extends FragmentEx implements SharedPreferences.OnS
}
});
swAddresses.setChecked(prefs.getBoolean("addresses", true));
swAddresses.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
@Override
public void onCheckedChanged(CompoundButton compoundButton, boolean checked) {
prefs.edit().putBoolean("addresses", checked).apply();
}
});
swPull.setChecked(prefs.getBoolean("pull", true));
swPull.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
@Override