mirror of
https://github.com/M66B/FairEmail.git
synced 2025-01-01 04:35:57 +00:00
Added Thunderbird keyword aliases
This commit is contained in:
parent
3fc182caf8
commit
a246a5cb4f
4 changed files with 29 additions and 3 deletions
|
@ -76,7 +76,7 @@ public class AdapterKeyword extends RecyclerView.Adapter<AdapterKeyword.ViewHold
|
|||
}
|
||||
|
||||
private void bindTo(TupleKeyword keyword) {
|
||||
cbKeyword.setText(keyword.name);
|
||||
cbKeyword.setText(EntityMessage.getKeywordAlias(context, keyword.name));
|
||||
cbKeyword.setChecked(keyword.selected);
|
||||
cbKeyword.setEnabled(pro);
|
||||
btnColor.setColor(keyword.color);
|
||||
|
|
|
@ -4282,14 +4282,16 @@ public class AdapterMessage extends RecyclerView.Adapter<AdapterMessage.ViewHold
|
|||
if (keywords.length() > 0)
|
||||
keywords.append(" ");
|
||||
|
||||
keywords.append(message.keywords[i]);
|
||||
// Thunderbird
|
||||
String keyword = EntityMessage.getKeywordAlias(context, message.keywords[i]);
|
||||
keywords.append(keyword);
|
||||
|
||||
if (message.keyword_colors != null &&
|
||||
message.keyword_colors[i] != null) {
|
||||
int len = keywords.length();
|
||||
keywords.setSpan(
|
||||
new ForegroundColorSpan(message.keyword_colors[i]),
|
||||
len - message.keywords[i].length(), len,
|
||||
len - keyword.length(), len,
|
||||
Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -274,6 +274,23 @@ public class EntityMessage implements Serializable {
|
|||
}
|
||||
}
|
||||
|
||||
static String getKeywordAlias(Context context, String keyword) {
|
||||
switch (keyword) {
|
||||
case "$label1": // Important
|
||||
return context.getString(R.string.title_keyword_label1);
|
||||
case "$label2": // Work
|
||||
return context.getString(R.string.title_keyword_label2);
|
||||
case "$label3": // Personal
|
||||
return context.getString(R.string.title_keyword_label3);
|
||||
case "$label4": // To do
|
||||
return context.getString(R.string.title_keyword_label4);
|
||||
case "$label5": // Later
|
||||
return context.getString(R.string.title_keyword_label5);
|
||||
default:
|
||||
return keyword;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object obj) {
|
||||
if (obj instanceof EntityMessage) {
|
||||
|
|
|
@ -1242,6 +1242,13 @@
|
|||
<item quantity="other">%1$d messages</item>
|
||||
</plurals>
|
||||
|
||||
<!-- Thunderbird -->
|
||||
<string name="title_keyword_label1">Important</string>
|
||||
<string name="title_keyword_label2">Work</string>
|
||||
<string name="title_keyword_label3">Personal</string>
|
||||
<string name="title_keyword_label4">To do</string>
|
||||
<string name="title_keyword_label5">Later</string>
|
||||
|
||||
<string name="title_accessibility_flagged">Starred</string>
|
||||
<string name="title_accessibility_unflagged">Unstarred</string>
|
||||
<string name="title_accessibility_collapse">Collapse</string>
|
||||
|
|
Loading…
Reference in a new issue