mirror of
https://github.com/M66B/FairEmail.git
synced 2026-05-19 13:34:00 +02:00
Added Thunderbird keyword aliases
This commit is contained in:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user