pull/207/head
M66B 3 years ago
parent ab52d3f39c
commit 1962b88d8d

@ -311,7 +311,6 @@ public class FragmentMessages extends FragmentBase implements SharedPreferences.
private boolean cards;
private boolean dividers;
private boolean category;
private boolean date;
private boolean date_fixed;
private boolean date_bold;
@ -447,7 +446,6 @@ public class FragmentMessages extends FragmentBase implements SharedPreferences.
swipenav = prefs.getBoolean("swipenav", true);
cards = prefs.getBoolean("cards", true);
dividers = prefs.getBoolean("dividers", true);
category = prefs.getBoolean("group_category", false);
date = prefs.getBoolean("date", true);
date_fixed = (!date && prefs.getBoolean("date_fixed", false));
date_bold = prefs.getBoolean("date_bold", false);
@ -833,14 +831,9 @@ public class FragmentMessages extends FragmentBase implements SharedPreferences.
if (message == null)
return null;
boolean ch = (category &&
viewType == AdapterMessage.ViewType.UNIFIED &&
(pos == 0
? message.accountCategory != null
: !Objects.equals(prev.accountCategory, message.accountCategory)));
boolean dh = (date && !date_fixed && SORT_DATE_HEADER.contains(adapter.getSort()));
if (!ch && !dh)
if (!dh)
return null;
if (pos > 0) {
@ -856,21 +849,15 @@ public class FragmentMessages extends FragmentBase implements SharedPreferences.
dh = false;
}
if (!ch && !dh)
if (!dh)
return null;
View header = inflater.inflate(R.layout.item_group, parent, false);
TextView tvCategory = header.findViewById(R.id.tvCategory);
TextView tvDate = header.findViewById(R.id.tvDate);
tvCategory.setVisibility(ch ? View.VISIBLE : View.GONE);
tvCategory.setVisibility(View.GONE);
tvDate.setVisibility(dh ? View.VISIBLE : View.GONE);
if (ch) {
tvCategory.setText(message.accountCategory);
if (date_bold)
tvCategory.setTypeface(Typeface.DEFAULT_BOLD);
}
if (dh) {
int zoom = adapter.getZoom();
if (zoom > 0)

@ -136,7 +136,7 @@ public class FragmentOptions extends FragmentBase {
"portrait2", "portrait2c", "portrait_min_size", "landscape", "landscape_min_size",
"column_width",
"nav_count", "nav_unseen_drafts", "nav_count_pinned", "navbar_colorize",
"indentation", "group_category", "date", "date_fixed", "date_bold", "threading", "threading_unread",
"indentation", "date", "date_fixed", "date_bold", "threading", "threading_unread",
"highlight_unread", "highlight_color", "color_stripe", "color_stripe_wide",
"avatars", "bimi", "gravatars", "favicons", "generated_icons", "identicons", "circular", "saturation", "brightness", "threshold",
"authentication", "authentication_indicator",

@ -72,7 +72,6 @@ public class FragmentOptionsDisplay extends FragmentBase implements SharedPrefer
private SwitchCompat swShadow;
private SwitchCompat swShadowHighlight;
private SwitchCompat swTabularDividers;
private SwitchCompat swCategory;
private SwitchCompat swDate;
private SwitchCompat swDateFixed;
private SwitchCompat swDateBold;
@ -186,7 +185,7 @@ public class FragmentOptionsDisplay extends FragmentBase implements SharedPrefer
private final static String[] RESET_OPTIONS = new String[]{
"theme", "startup",
"cards", "beige", "tabular_card_bg", "shadow_unread", "shadow_highlight", "dividers",
"group_category", "date", "date_fixed", "date_bold",
"date", "date_fixed", "date_bold",
"portrait2", "portrait2c", "landscape", "close_pane", "column_width",
"nav_options", "nav_count", "nav_unseen_drafts", "nav_count_pinned", "navbar_colorize",
"threading", "threading_unread", "indentation", "seekbar", "actionbar", "actionbar_color",
@ -226,7 +225,6 @@ public class FragmentOptionsDisplay extends FragmentBase implements SharedPrefer
swShadow = view.findViewById(R.id.swShadow);
swShadowHighlight = view.findViewById(R.id.swShadowHighlight);
swTabularDividers = view.findViewById(R.id.swTabularDividers);
swCategory = view.findViewById(R.id.swCategory);
swDate = view.findViewById(R.id.swDate);
swDateFixed = view.findViewById(R.id.swDateFixed);
swDateBold = view.findViewById(R.id.swDateBold);
@ -428,13 +426,6 @@ public class FragmentOptionsDisplay extends FragmentBase implements SharedPrefer
}
});
swCategory.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
@Override
public void onCheckedChanged(CompoundButton compoundButton, boolean checked) {
prefs.edit().putBoolean("group_category", checked).apply();
}
});
swDate.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
@Override
public void onCheckedChanged(CompoundButton compoundButton, boolean checked) {
@ -1299,7 +1290,6 @@ public class FragmentOptionsDisplay extends FragmentBase implements SharedPrefer
swShadowHighlight.setEnabled(swShadow.isEnabled() && swShadow.isChecked());
swTabularDividers.setChecked(prefs.getBoolean("dividers", true));
swTabularDividers.setEnabled(!swCards.isChecked());
swCategory.setChecked(prefs.getBoolean("group_category", false));
swDate.setChecked(prefs.getBoolean("date", true));
swDateFixed.setChecked(prefs.getBoolean("date_fixed", false));
swDateFixed.setEnabled(!swDate.isChecked());

@ -196,18 +196,6 @@
app:layout_constraintTop_toBottomOf="@id/swShadowHighlight"
app:switchPadding="12dp" />
<androidx.appcompat.widget.SwitchCompat
android:id="@+id/swCategory"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginTop="12dp"
android:checked="true"
android:text="@string/title_advanced_category_header"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/swTabularDividers"
app:switchPadding="12dp" />
<androidx.appcompat.widget.SwitchCompat
android:id="@+id/swDate"
android:layout_width="0dp"
@ -217,7 +205,7 @@
android:text="@string/title_advanced_date_header"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/swCategory"
app:layout_constraintTop_toBottomOf="@id/swTabularDividers"
app:switchPadding="12dp" />
<eu.faircode.email.FixedTextView

Loading…
Cancel
Save