diff options
Diffstat (limited to 'java/com/android/incallui/rtt/impl/RttChatAdapter.java')
-rw-r--r-- | java/com/android/incallui/rtt/impl/RttChatAdapter.java | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/java/com/android/incallui/rtt/impl/RttChatAdapter.java b/java/com/android/incallui/rtt/impl/RttChatAdapter.java index f1cde759c..160377889 100644 --- a/java/com/android/incallui/rtt/impl/RttChatAdapter.java +++ b/java/com/android/incallui/rtt/impl/RttChatAdapter.java @@ -29,6 +29,7 @@ import android.view.ViewGroup; import com.android.dialer.common.LogUtil; import com.android.dialer.rtt.RttTranscript; import com.android.dialer.rtt.RttTranscriptMessage; +import com.android.incallui.rtt.protocol.RttChatMessage; import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; import java.util.ArrayList; @@ -133,13 +134,13 @@ public class RttChatAdapter extends RecyclerView.Adapter<ViewHolder> { 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)); |