mirror of
https://github.com/M66B/FairEmail.git
synced 2024-12-28 18:59:01 +00:00
Optimization
This commit is contained in:
parent
a9fea7e4d1
commit
20f0aa63a7
1 changed files with 10 additions and 9 deletions
|
@ -511,12 +511,6 @@ public class AdapterMessage extends RecyclerView.Adapter<AdapterMessage.ViewHold
|
||||||
ViewHolder(final View itemView, long viewType) {
|
ViewHolder(final View itemView, long viewType) {
|
||||||
super(itemView);
|
super(itemView);
|
||||||
|
|
||||||
if (cards && shadow_unread) {
|
|
||||||
ViewGroup.MarginLayoutParams lparam = (ViewGroup.MarginLayoutParams) itemView.getLayoutParams();
|
|
||||||
lparam.bottomMargin = dp1;
|
|
||||||
itemView.setLayoutParams(lparam);
|
|
||||||
}
|
|
||||||
|
|
||||||
card = itemView.findViewById(R.id.card);
|
card = itemView.findViewById(R.id.card);
|
||||||
view = itemView.findViewById(R.id.clItem);
|
view = itemView.findViewById(R.id.clItem);
|
||||||
header = itemView.findViewById(R.id.inHeader);
|
header = itemView.findViewById(R.id.inHeader);
|
||||||
|
@ -1401,12 +1395,19 @@ public class AdapterMessage extends RecyclerView.Adapter<AdapterMessage.ViewHold
|
||||||
|
|
||||||
private void bindSeen(TupleMessageEx message) {
|
private void bindSeen(TupleMessageEx message) {
|
||||||
if (cards && shadow_unread) {
|
if (cards && shadow_unread) {
|
||||||
int color = (message.unseen > 0
|
boolean shadow = (message.unseen > 0);
|
||||||
|
int color = (shadow
|
||||||
? ColorUtils.setAlphaComponent(colorAccent, 127)
|
? ColorUtils.setAlphaComponent(colorAccent, 127)
|
||||||
: Color.TRANSPARENT);
|
: Color.TRANSPARENT);
|
||||||
if (!Objects.equals(itemView.getTag(), color)) {
|
if (!Objects.equals(itemView.getTag(), shadow)) {
|
||||||
itemView.setTag(color);
|
itemView.setTag(shadow);
|
||||||
|
|
||||||
itemView.setBackgroundColor(color);
|
itemView.setBackgroundColor(color);
|
||||||
|
|
||||||
|
ViewGroup.MarginLayoutParams lparam = (ViewGroup.MarginLayoutParams) itemView.getLayoutParams();
|
||||||
|
lparam.topMargin = (shadow ? dp1 : 0);
|
||||||
|
lparam.bottomMargin = (shadow ? dp1 : 0);
|
||||||
|
itemView.setLayoutParams(lparam);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue