mirror of
https://github.com/M66B/FairEmail.git
synced 2026-05-19 13:34:00 +02:00
Added option to enable unified system folders
This commit is contained in:
@@ -358,14 +358,16 @@ public class ActivityView extends ActivityBilling implements FragmentManager.OnB
|
||||
}
|
||||
});
|
||||
|
||||
db.folder().liveUnifiedTypes().observe(this, new Observer<List<String>>() {
|
||||
@Override
|
||||
public void onChanged(List<String> types) {
|
||||
if (types == null)
|
||||
types = new ArrayList<>();
|
||||
uadapter.set(types);
|
||||
}
|
||||
});
|
||||
boolean unified_system = prefs.getBoolean("unified_system", false);
|
||||
if (unified_system)
|
||||
db.folder().liveUnifiedTypes().observe(this, new Observer<List<String>>() {
|
||||
@Override
|
||||
public void onChanged(List<String> types) {
|
||||
if (types == null)
|
||||
types = new ArrayList<>();
|
||||
uadapter.set(types);
|
||||
}
|
||||
});
|
||||
|
||||
db.folder().liveNavigation().observe(this, new Observer<List<TupleFolderNav>>() {
|
||||
@Override
|
||||
|
||||
@@ -39,7 +39,7 @@ public class FragmentOptions extends FragmentBase {
|
||||
|
||||
static String[] OPTIONS_RESTART = new String[]{
|
||||
"startup", "date", "threading", "avatars", "identicons", "circular", "name_email", "subject_italic", "flags", "preview",
|
||||
"addresses", "attachments_alt", "contrast", "monospaced", "autohtml", "autoimages", "actionbar",
|
||||
"addresses", "attachments_alt", "contrast", "monospaced", "autohtml", "autoimages", "actionbar", "unified_system",
|
||||
"autoscroll", "swipenav", "autoexpand", "autoclose", "autonext",
|
||||
"subscriptions", "debug",
|
||||
"biometrics"
|
||||
|
||||
@@ -63,11 +63,12 @@ public class FragmentOptionsDisplay extends FragmentBase implements SharedPrefer
|
||||
private SwitchCompat swCollapseQuotes;
|
||||
private SwitchCompat swRemoteContent;
|
||||
private SwitchCompat swActionbar;
|
||||
private SwitchCompat swUnifiedSystem;
|
||||
|
||||
private final static String[] RESET_OPTIONS = new String[]{
|
||||
"theme", "startup", "date", "threading", "avatars", "identicons", "circular", "name_email", "subject_italic",
|
||||
"flags", "preview", "addresses", "attachments_alt",
|
||||
"contrast", "monospaced", "inline_images", "autoimages", "collapse_quotes", "autocontent", "actionbar",
|
||||
"contrast", "monospaced", "inline_images", "autoimages", "collapse_quotes", "autocontent", "actionbar", "unified_system"
|
||||
};
|
||||
|
||||
@Override
|
||||
@@ -100,6 +101,7 @@ public class FragmentOptionsDisplay extends FragmentBase implements SharedPrefer
|
||||
swCollapseQuotes = view.findViewById(R.id.swCollapseQuotes);
|
||||
swRemoteContent = view.findViewById(R.id.swRemoteContent);
|
||||
swActionbar = view.findViewById(R.id.swActionbar);
|
||||
swUnifiedSystem = view.findViewById(R.id.swUnifiedSystem);
|
||||
|
||||
setOptions();
|
||||
|
||||
@@ -256,6 +258,13 @@ public class FragmentOptionsDisplay extends FragmentBase implements SharedPrefer
|
||||
}
|
||||
});
|
||||
|
||||
swUnifiedSystem.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
|
||||
@Override
|
||||
public void onCheckedChanged(CompoundButton compoundButton, boolean checked) {
|
||||
prefs.edit().putBoolean("unified_system", checked).apply();
|
||||
}
|
||||
});
|
||||
|
||||
PreferenceManager.getDefaultSharedPreferences(getContext()).registerOnSharedPreferenceChangeListener(this);
|
||||
|
||||
return view;
|
||||
@@ -329,6 +338,7 @@ public class FragmentOptionsDisplay extends FragmentBase implements SharedPrefer
|
||||
swCollapseQuotes.setChecked(prefs.getBoolean("collapse_quotes", false));
|
||||
swRemoteContent.setChecked(prefs.getBoolean("autocontent", false));
|
||||
swActionbar.setChecked(prefs.getBoolean("actionbar", true));
|
||||
swUnifiedSystem.setChecked(prefs.getBoolean("unified_system", false));
|
||||
}
|
||||
|
||||
public static class FragmentDialogTheme extends DialogFragmentEx {
|
||||
|
||||
Reference in New Issue
Block a user