Added option to disable priority indicator

This commit is contained in:
M66B 2023-08-26 22:12:05 +02:00
parent fe3ed991b4
commit c687019c8c
5 changed files with 36 additions and 9 deletions

View File

@ -291,6 +291,7 @@ public class AdapterMessage extends RecyclerView.Adapter<AdapterMessage.ViewHold
private String subject_ellipsize;
private boolean show_filtered;
private boolean priority_indicator;
private boolean keywords_header;
private boolean labels_header;
private boolean flags;
@ -1382,12 +1383,15 @@ public class AdapterMessage extends RecyclerView.Adapter<AdapterMessage.ViewHold
} else
ibAuth.setVisibility(View.GONE);
if (EntityMessage.PRIORITIY_HIGH.equals(message.ui_priority)) {
ibPriority.setImageLevel(message.ui_priority);
ibPriority.setVisibility(View.VISIBLE);
} else if (EntityMessage.PRIORITIY_LOW.equals(message.ui_priority)) {
ibPriority.setImageLevel(message.ui_priority);
ibPriority.setVisibility(View.VISIBLE);
if (priority_indicator || outgoing) {
if (EntityMessage.PRIORITIY_HIGH.equals(message.ui_priority)) {
ibPriority.setImageLevel(message.ui_priority);
ibPriority.setVisibility(View.VISIBLE);
} else if (EntityMessage.PRIORITIY_LOW.equals(message.ui_priority)) {
ibPriority.setImageLevel(message.ui_priority);
ibPriority.setVisibility(View.VISIBLE);
} else
ibPriority.setVisibility(View.GONE);
} else
ibPriority.setVisibility(View.GONE);
@ -7885,6 +7889,7 @@ public class AdapterMessage extends RecyclerView.Adapter<AdapterMessage.ViewHold
this.sender_ellipsize = prefs.getString("sender_ellipsize", "end");
this.subject_ellipsize = prefs.getString("subject_ellipsize", "full");
this.show_filtered = prefs.getBoolean("show_filtered", false);
this.priority_indicator = prefs.getBoolean("priority_indicator", true);
this.keywords_header = prefs.getBoolean("keywords_header", false);
this.labels_header = prefs.getBoolean("labels_header", true);
this.flags = prefs.getBoolean("flags", true);

View File

@ -145,7 +145,7 @@ public class FragmentOptions extends FragmentBase {
"email_format", "prefer_contact", "only_contact", "distinguish_contacts", "show_recipients",
"font_size_sender", "sender_ellipsize",
"subject_top", "subject_italic", "highlight_subject", "font_size_subject", "subject_ellipsize",
"keywords_header", "labels_header", "flags", "flags_background", "preview", "preview_italic", "preview_lines", "align_header",
"priority_indicator", "keywords_header", "labels_header", "flags", "flags_background", "preview", "preview_italic", "preview_lines", "align_header",
"message_zoom", "overview_mode", "addresses", "button_extra", "attachments_alt", "thumbnails",
"contrast", "hyphenation", "display_font", "monospaced_pre",
"list_count", "bundled_fonts", "parse_classes",

View File

@ -150,6 +150,7 @@ public class FragmentOptionsDisplay extends FragmentBase implements SharedPrefer
private Spinner spFontSizeSubject;
private Spinner spSubjectEllipsize;
private SwitchCompat swPriorityIndicator;
private SwitchCompat swKeywords;
private SwitchCompat swLabels;
private SwitchCompat swFlags;
@ -212,7 +213,7 @@ public class FragmentOptionsDisplay extends FragmentBase implements SharedPrefer
"email_format", "prefer_contact", "only_contact", "distinguish_contacts", "show_recipients",
"font_size_sender", "sender_ellipsize",
"subject_top", "subject_italic", "highlight_subject", "font_size_subject", "subject_ellipsize",
"keywords_header", "labels_header", "flags", "flags_background",
"priority_indicator", "keywords_header", "labels_header", "flags", "flags_background",
"preview", "preview_italic", "preview_lines", "align_header",
"addresses", "hide_attachments",
"message_zoom", "editor_zoom", "overview_mode",
@ -321,6 +322,7 @@ public class FragmentOptionsDisplay extends FragmentBase implements SharedPrefer
spFontSizeSubject = view.findViewById(R.id.spFontSizeSubject);
spSubjectEllipsize = view.findViewById(R.id.spSubjectEllipsize);
swPriorityIndicator = view.findViewById(R.id.swPriorityIndicator);
swKeywords = view.findViewById(R.id.swKeywords);
swLabels = view.findViewById(R.id.swLabels);
swFlags = view.findViewById(R.id.swFlags);
@ -1088,6 +1090,13 @@ public class FragmentOptionsDisplay extends FragmentBase implements SharedPrefer
}
});
swPriorityIndicator.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
@Override
public void onCheckedChanged(CompoundButton compoundButton, boolean checked) {
prefs.edit().putBoolean("priority_indicator", checked).apply();
}
});
swKeywords.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
@Override
public void onCheckedChanged(CompoundButton compoundButton, boolean checked) {
@ -1582,6 +1591,7 @@ public class FragmentOptionsDisplay extends FragmentBase implements SharedPrefer
break;
}
swPriorityIndicator.setChecked(prefs.getBoolean("priority_indicator", true));
swKeywords.setChecked(prefs.getBoolean("keywords_header", false));
swLabels.setChecked(prefs.getBoolean("labels_header", true));
swFlags.setChecked(prefs.getBoolean("flags", true));

View File

@ -1519,6 +1519,17 @@
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/tvSubjectEllipsizeRemark" />
<androidx.appcompat.widget.SwitchCompat
android:id="@+id/swPriorityIndicator"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginTop="12dp"
android:text="@string/title_advanced_priority_indicator"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/vSeparatorOther"
app:switchPadding="12dp" />
<androidx.appcompat.widget.SwitchCompat
android:id="@+id/swKeywords"
android:layout_width="0dp"
@ -1527,7 +1538,7 @@
android:text="@string/title_advanced_keywords"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/vSeparatorOther"
app:layout_constraintTop_toBottomOf="@id/swPriorityIndicator"
app:switchPadding="12dp" />
<androidx.appcompat.widget.SwitchCompat

View File

@ -600,6 +600,7 @@
<string name="title_advanced_compact_mode_remark">Compact mode only</string>
<string name="title_advanced_highlight_color">Highlight color</string>
<string name="title_advanced_priority_indicator">Show priority indicator</string>
<string name="title_advanced_keywords">Show keywords in message header</string>
<string name="title_advanced_labels">Show Gmail labels in message header</string>
<string name="title_advanced_flags">Show stars</string>