mirror of
https://github.com/M66B/FairEmail.git
synced 2026-01-02 19:10:11 +01:00
Added section to collapse addresses section by default
This commit is contained in:
@@ -41,7 +41,7 @@ abstract class ActivityBase extends AppCompatActivity implements SharedPreferenc
|
||||
private boolean contacts;
|
||||
|
||||
private static String[] restart = new String[]{
|
||||
"unified", "threading", "compact", "avatars", "identicons", "preview",
|
||||
"unified", "threading", "compact", "avatars", "identicons", "preview", "addresses",
|
||||
"pull", "actionbar", "autoclose", "confirm", "debug"
|
||||
};
|
||||
|
||||
|
||||
@@ -117,6 +117,7 @@ public class FragmentMessages extends FragmentEx {
|
||||
private boolean pull;
|
||||
private boolean actionbar;
|
||||
private boolean autoclose;
|
||||
private boolean addresses;
|
||||
|
||||
private long primary = -1;
|
||||
private boolean outbox = false;
|
||||
@@ -178,7 +179,7 @@ public class FragmentMessages extends FragmentEx {
|
||||
threading = prefs.getBoolean("threading", true);
|
||||
actionbar = prefs.getBoolean("actionbar", true);
|
||||
autoclose = prefs.getBoolean("autoclose", true);
|
||||
|
||||
addresses = prefs.getBoolean("addresses", true);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -350,6 +351,8 @@ public class FragmentMessages extends FragmentEx {
|
||||
public boolean getValue(String name, long id) {
|
||||
if (values.containsKey(name))
|
||||
return values.get(name).contains(id);
|
||||
else if ("addresses".equals(name))
|
||||
return !addresses;
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user