Added option to always show date and time

This commit is contained in:
M66B
2023-05-19 15:02:13 +02:00
parent 2b95587e00
commit 4fa0377b3e
5 changed files with 32 additions and 4 deletions

View File

@@ -71,6 +71,7 @@ public class FragmentOptionsDisplay extends FragmentBase implements SharedPrefer
private SwitchCompat swDateWeek;
private SwitchCompat swDateFixed;
private SwitchCompat swDateBold;
private SwitchCompat swDateTime;
private SwitchCompat swCategory;
private SwitchCompat swCards;
private SwitchCompat swBeige;
@@ -198,7 +199,7 @@ public class FragmentOptionsDisplay extends FragmentBase implements SharedPrefer
private final static String[] RESET_OPTIONS = new String[]{
"theme", "startup",
"date", "date_week", "date_fixed", "date_bold", "group_category",
"date", "date_week", "date_fixed", "date_bold", "date_time", "group_category",
"cards", "beige", "tabular_card_bg", "shadow_unread", "shadow_border", "shadow_highlight", "dividers",
"portrait2", "portrait2c", "landscape", "close_pane", "open_pane", "column_width",
"hide_toolbar", "nav_options", "nav_categories", "nav_last_sync", "nav_count", "nav_unseen_drafts", "nav_count_pinned", "navbar_colorize",
@@ -239,6 +240,7 @@ public class FragmentOptionsDisplay extends FragmentBase implements SharedPrefer
swDateWeek = view.findViewById(R.id.swDateWeek);
swDateFixed = view.findViewById(R.id.swDateFixed);
swDateBold = view.findViewById(R.id.swDateBold);
swDateTime = view.findViewById(R.id.swDateTime);
swCategory = view.findViewById(R.id.swCategory);
swCards = view.findViewById(R.id.swCards);
swBeige = view.findViewById(R.id.swBeige);
@@ -445,6 +447,13 @@ public class FragmentOptionsDisplay extends FragmentBase implements SharedPrefer
}
});
swDateTime.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
@Override
public void onCheckedChanged(CompoundButton compoundButton, boolean checked) {
prefs.edit().putBoolean("date_time", checked).apply();
}
});
swCategory.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
@Override
public void onCheckedChanged(CompoundButton compoundButton, boolean checked) {
@@ -1425,6 +1434,7 @@ public class FragmentOptionsDisplay extends FragmentBase implements SharedPrefer
swDateFixed.setEnabled(!swDate.isChecked());
swDateBold.setChecked(prefs.getBoolean("date_bold", false));
swDateBold.setEnabled(swDate.isChecked() || swDateFixed.isChecked());
swDateTime.setChecked(prefs.getBoolean("date_time", false));
swCategory.setChecked(prefs.getBoolean("group_category", false));
swCards.setChecked(prefs.getBoolean("cards", true));
swBeige.setChecked(prefs.getBoolean("beige", true));