From 90a68377c36abccde8c4f1e5d3aa781944a1413c Mon Sep 17 00:00:00 2001 From: wangqi Date: Mon, 30 Apr 2018 12:40:13 -0700 Subject: Fix bug that displaying local message is not in sync. Test: manual PiperOrigin-RevId: 194828525 Change-Id: Ib9f1faece83525c00feadf32b43a6901d54ea76e --- java/com/android/incallui/rtt/impl/RttChatAdapter.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'java/com/android') diff --git a/java/com/android/incallui/rtt/impl/RttChatAdapter.java b/java/com/android/incallui/rtt/impl/RttChatAdapter.java index 96ff58b79..160377889 100644 --- a/java/com/android/incallui/rtt/impl/RttChatAdapter.java +++ b/java/com/android/incallui/rtt/impl/RttChatAdapter.java @@ -134,13 +134,13 @@ public class RttChatAdapter extends RecyclerView.Adapter { rttChatMessage.append(newMessage); rttMessages.add(rttChatMessage); lastIndexOfLocalMessage = rttMessages.size() - 1; - notifyItemInserted(lastIndexOfLocalMessage); + notifyItemInserted(toItemPosition(lastIndexOfLocalMessage)); } else { rttChatMessage.append(newMessage); // Clear empty message bubble. if (TextUtils.isEmpty(rttChatMessage.getContent())) { rttMessages.remove(lastIndexOfLocalMessage); - notifyItemRemoved(lastIndexOfLocalMessage); + notifyItemRemoved(toItemPosition(lastIndexOfLocalMessage)); lastIndexOfLocalMessage = -1; } else { notifyItemChanged(toItemPosition(lastIndexOfLocalMessage)); -- cgit v1.2.3