Fixed recycler caching issue

pull/178/head
M66B 5 years ago
parent abe2e4bce2
commit 4504058840

@ -5142,16 +5142,6 @@ public class AdapterMessage extends RecyclerView.Adapter<AdapterMessage.ViewHold
holder.wire(); holder.wire();
} }
public void collapse(@NonNull ViewHolder holder, int position) {
int type = holder.getItemViewType();
if (type != R.layout.item_message_compact && type != R.layout.item_message_normal)
return;
TupleMessageEx message = getItemAtPosition(position);
if (message != null)
holder.clearExpanded(message);
}
public void onItemSelected(@NonNull ViewHolder holder, boolean selected) { public void onItemSelected(@NonNull ViewHolder holder, boolean selected) {
if (accessibility && holder.view != null) if (accessibility && holder.view != null)
try { try {

@ -1474,11 +1474,8 @@ public class FragmentMessages extends FragmentBase implements SharedPreferences.
int pos = adapter.getPositionForKey(other); int pos = adapter.getPositionForKey(other);
if (pos == NO_POSITION) if (pos == NO_POSITION)
continue; continue;
AdapterMessage.ViewHolder holder =
(AdapterMessage.ViewHolder) rvMessage.findViewHolderForAdapterPosition(pos); adapter.notifyItemChanged(pos);
if (holder == null)
continue;
adapter.collapse(holder, pos);
} }
} }

Loading…
Cancel
Save