Fixed shadow rendering

This commit is contained in:
M66B 2021-02-16 22:42:46 +01:00
parent 75d6925523
commit c827dffabf
1 changed files with 7 additions and 6 deletions

View File

@ -46,7 +46,6 @@ import android.graphics.Paint;
import android.graphics.Rect;
import android.graphics.Typeface;
import android.graphics.drawable.AnimatedImageDrawable;
import android.graphics.drawable.ColorDrawable;
import android.graphics.drawable.Drawable;
import android.net.Uri;
import android.os.Build;
@ -228,7 +227,6 @@ public class AdapterMessage extends RecyclerView.Adapter<AdapterMessage.ViewHold
private int colorSeparator;
private int colorError;
private int colorControlNormal;
private Drawable drawableSeparator;
private boolean hasWebView;
private boolean pin;
@ -1402,8 +1400,13 @@ public class AdapterMessage extends RecyclerView.Adapter<AdapterMessage.ViewHold
}
private void bindSeen(TupleMessageEx message) {
if (cards && shadow)
itemView.setBackground(message.unseen > 0 ? drawableSeparator : null);
if (cards && shadow) {
int color = (message.unseen > 0 ? colorSeparator : Color.TRANSPARENT);
if (!Objects.equals(itemView.getTag(), color)) {
itemView.setTag(color);
itemView.setBackgroundColor(color);
}
}
if (textSize != 0) {
float fz_sender = (font_size_sender == null ? textSize : font_size_sender) * (message.unseen > 0 ? 1.1f : 1f);
@ -5332,8 +5335,6 @@ public class AdapterMessage extends RecyclerView.Adapter<AdapterMessage.ViewHold
this.colorError = Helper.resolveColor(context, R.attr.colorError);
this.colorControlNormal = Helper.resolveColor(context, R.attr.colorControlNormal);
this.drawableSeparator = new ColorDrawable(colorSeparator);
this.hasWebView = Helper.hasWebView(context);
this.pin = ShortcutManagerCompat.isRequestPinShortcutSupported(context);
this.contacts = Helper.hasPermission(context, Manifest.permission.READ_CONTACTS);