diff --git a/app/src/main/java/eu/faircode/email/AdapterRule.java b/app/src/main/java/eu/faircode/email/AdapterRule.java index 249e628d7d..74548dcd60 100644 --- a/app/src/main/java/eu/faircode/email/AdapterRule.java +++ b/app/src/main/java/eu/faircode/email/AdapterRule.java @@ -264,8 +264,10 @@ public class AdapterRule extends RecyclerView.Adapter { if (TextUtils.isEmpty(method)) method = "GET"; setAction(getAction(type), method + " " + url); - } else - setAction(getAction(type), null); + } else { + boolean seen = jaction.optBoolean("seen"); + setAction(getAction(type), seen ? context.getString(R.string.title_rule_seen) : null, null); + } if (type == EntityRule.TYPE_MOVE || type == EntityRule.TYPE_COPY || (type == EntityRule.TYPE_ANSWER && TextUtils.isEmpty(to))) { @@ -302,7 +304,9 @@ public class AdapterRule extends RecyclerView.Adapter { if (id != AdapterRule.this.getItemId(pos)) return; - setAction(getAction(args.getInt("type")), value); + boolean seen = jaction.optBoolean("seen"); + setAction(getAction(args.getInt("type")), + seen ? context.getString(R.string.title_rule_seen) : null, value); } @Override @@ -565,16 +569,24 @@ public class AdapterRule extends RecyclerView.Adapter { } private void setAction(int resid, String value) { - if (TextUtils.isEmpty(value)) + setAction(resid, null, value); + } + + private void setAction(int resid, String extra, String value) { + if (TextUtils.isEmpty(extra) && TextUtils.isEmpty(value)) tvAction.setText(resid); else { SpannableStringBuilder ssb = new SpannableStringBuilderEx(); ssb.append(context.getString(resid)); - ssb.append(" \""); - int start = ssb.length(); - ssb.append(value); - ssb.setSpan(new StyleSpan(Typeface.ITALIC), start, ssb.length(), 0); - ssb.append("\""); + if (extra != null) + ssb.append('+').append(extra); + if (value != null) { + ssb.append(" \""); + int start = ssb.length(); + ssb.append(value); + ssb.setSpan(new StyleSpan(Typeface.ITALIC), start, ssb.length(), 0); + ssb.append("\""); + } tvAction.setText(ssb); } }