Added import/not important group headers

This commit is contained in:
M66B 2023-12-02 20:17:59 +01:00
parent a0d9c07e6d
commit 73752804a3
2 changed files with 17 additions and 4 deletions

View File

@ -977,7 +977,13 @@ public class FragmentMessages extends FragmentBase
if (!ch && !dh)
return null;
if (pos > 0) {
if (EntityMessage.PRIORITIY_HIGH.equals(message.importance)) {
if (pos > 0)
return null;
} else if (EntityMessage.PRIORITIY_LOW.equals(message.importance)) {
if (EntityMessage.PRIORITIY_LOW.equals(prev.importance))
return null;
} else if (pos > 0) {
Calendar cal0 = Calendar.getInstance();
Calendar cal1 = Calendar.getInstance();
cal0.setMinimalDaysInFirstWeek(4); // ISO 8601
@ -1024,9 +1030,14 @@ public class FragmentMessages extends FragmentBase
vSeparator.setVisibility(View.GONE);
}
tvDate.setText(date_week
? getWeek(message.received, parent.getContext())
: getRelativeDate(message.received, parent.getContext()));
if (EntityMessage.PRIORITIY_HIGH.equals(message.importance))
tvDate.setText(R.string.title_is_important);
else if (EntityMessage.PRIORITIY_LOW.equals(message.importance))
tvDate.setText(R.string.title_is_not_important);
else
tvDate.setText(date_week
? getWeek(message.received, parent.getContext())
: getRelativeDate(message.received, parent.getContext()));
view.setContentDescription(tvDate.getText().toString());
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.P)

View File

@ -1419,6 +1419,8 @@
<string name="title_importance_low">Low</string>
<string name="title_importance_normal">Normal</string>
<string name="title_importance_high">High</string>
<string name="title_is_important">Important</string>
<string name="title_is_not_important">Not important</string>
<string name="title_search_in_text">Search in text &#8230;</string>
<string name="title_forward">Forward</string>
<string name="title_resend">Resend</string>