1
0
mirror of https://github.com/KokaKiwi/BarInsta synced 2024-11-26 08:37:29 +00:00

Handle null client context for action log direct items and hide message info for call events

This commit is contained in:
Ammar Githam 2021-01-02 13:18:16 +09:00
parent d42d4dd3ea
commit 502d72ecd8
2 changed files with 4 additions and 1 deletions

View File

@ -215,6 +215,9 @@ public final class DirectItemsAdapter extends RecyclerView.Adapter<RecyclerView.
if (itemOrHeader.isHeader()) { if (itemOrHeader.isHeader()) {
return itemOrHeader.date.hashCode(); return itemOrHeader.date.hashCode();
} }
if (itemOrHeader.item.getClientContext() == null) {
return itemOrHeader.item.getItemId().hashCode();
}
return itemOrHeader.item.getClientContext().hashCode(); return itemOrHeader.item.getClientContext().hashCode();
} }

View File

@ -91,7 +91,7 @@ public abstract class DirectItemViewHolder extends RecyclerView.ViewHolder {
binding.ivProfilePic.setVisibility(View.GONE); binding.ivProfilePic.setVisibility(View.GONE);
binding.tvUsername.setVisibility(View.GONE); binding.tvUsername.setVisibility(View.GONE);
containerLayoutParams.gravity = Gravity.CENTER; containerLayoutParams.gravity = Gravity.CENTER;
if (itemType == DirectItemType.ACTION_LOG) { if (itemType == DirectItemType.ACTION_LOG || itemType == DirectItemType.VIDEO_CALL_EVENT) {
binding.messageInfo.setVisibility(View.GONE); binding.messageInfo.setVisibility(View.GONE);
} }
} }