From 16276d0345edfda01b0d832e646af49971d8fe28 Mon Sep 17 00:00:00 2001 From: M66B Date: Mon, 27 Dec 2021 17:49:10 +0100 Subject: [PATCH] Revert "Experiment: use shadow for selected messages" This reverts commit 43c2d0fe6aedfd446559f222bd7a202bfa4fb4c0. --- .../eu/faircode/email/AdapterMessage.java | 24 +++++++------------ 1 file changed, 9 insertions(+), 15 deletions(-) diff --git a/app/src/main/java/eu/faircode/email/AdapterMessage.java b/app/src/main/java/eu/faircode/email/AdapterMessage.java index 3a146984cf..26c834c05f 100644 --- a/app/src/main/java/eu/faircode/email/AdapterMessage.java +++ b/app/src/main/java/eu/faircode/email/AdapterMessage.java @@ -1626,25 +1626,19 @@ public class AdapterMessage extends RecyclerView.Adapter 0); - boolean selected = properties.getValue("selected", message.id); + if (cards && shadow_unread) { + boolean shadow = (message.unseen > 0); + int color = (shadow + ? ColorUtils.setAlphaComponent(shadow_highlight ? colorUnreadHighlight : colorAccent, 127) + : Color.TRANSPARENT); + if (!Objects.equals(itemView.getTag(), shadow)) { + itemView.setTag(shadow); - int color; - if (unseen) - color = ColorUtils.setAlphaComponent(shadow_highlight ? colorUnreadHighlight : colorAccent, 127); - else if (selected) - color = ColorUtils.setAlphaComponent(colorSeparator, 127); - else - color = Color.TRANSPARENT; - - if (!Objects.equals(itemView.getTag(), color)) { - itemView.setTag(color); itemView.setBackgroundColor(color); ViewGroup.MarginLayoutParams lparam = (ViewGroup.MarginLayoutParams) itemView.getLayoutParams(); - lparam.topMargin = (unseen || selected ? dp1 : 0); - lparam.bottomMargin = (unseen || selected ? dp1 : 0); + lparam.topMargin = (shadow ? dp1 : 0); + lparam.bottomMargin = (shadow ? dp1 : 0); itemView.setLayoutParams(lparam); } }