From 6ab4ad20fa1f04a607ffc75d58146791d242186a Mon Sep 17 00:00:00 2001 From: M66B Date: Mon, 10 Dec 2018 19:27:04 +0100 Subject: [PATCH] Flag colors --- .../main/java/eu/faircode/email/AdapterMessage.java | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/app/src/main/java/eu/faircode/email/AdapterMessage.java b/app/src/main/java/eu/faircode/email/AdapterMessage.java index 886eb7c2e9..d3a1d6715d 100644 --- a/app/src/main/java/eu/faircode/email/AdapterMessage.java +++ b/app/src/main/java/eu/faircode/email/AdapterMessage.java @@ -27,6 +27,7 @@ import android.content.DialogInterface; import android.content.Intent; import android.content.SharedPreferences; import android.content.pm.PackageManager; +import android.content.res.ColorStateList; import android.database.Cursor; import android.graphics.Bitmap; import android.graphics.BitmapFactory; @@ -368,12 +369,16 @@ public class AdapterMessage extends RecyclerView.Adapter 0 - ? R.drawable.baseline_star_24 : R.drawable.baseline_star_border_24); + flagged = (message.count - message.unflagged > 0); + ivFlagged.setImageResource(flagged ? R.drawable.baseline_star_24 : R.drawable.baseline_star_border_24); + ivFlagged.setImageTintList(ColorStateList.valueOf(flagged + ? Helper.resolveColor(context, R.attr.colorAccent) + : Helper.resolveColor(context, android.R.attr.textColorSecondary) + )); ivFlagged.setVisibility(View.VISIBLE); tvFrom.setText(MessageHelper.getFormattedAddresses(outgoing ? message.to : message.from, false));