diff options
Diffstat (limited to 'java/com/android/incallui/rtt/impl/RttChatAdapter.java')
-rw-r--r-- | java/com/android/incallui/rtt/impl/RttChatAdapter.java | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/java/com/android/incallui/rtt/impl/RttChatAdapter.java b/java/com/android/incallui/rtt/impl/RttChatAdapter.java index 8d924c9f8..955fc9fec 100644 --- a/java/com/android/incallui/rtt/impl/RttChatAdapter.java +++ b/java/com/android/incallui/rtt/impl/RttChatAdapter.java @@ -33,7 +33,9 @@ import java.util.List; public class RttChatAdapter extends RecyclerView.Adapter<RttChatMessageViewHolder> { interface MessageListener { - void newMessageAdded(); + void onUpdateRemoteMessage(int position); + + void onUpdateLocalMessage(int position); } private static final String KEY_MESSAGE_DATA = "key_message_data"; @@ -114,7 +116,7 @@ public class RttChatAdapter extends RecyclerView.Adapter<RttChatMessageViewHolde void addLocalMessage(String message) { updateCurrentLocalMessage(message); if (messageListener != null) { - messageListener.newMessageAdded(); + messageListener.onUpdateLocalMessage(lastIndexOfLocalMessage); } } @@ -143,7 +145,7 @@ public class RttChatAdapter extends RecyclerView.Adapter<RttChatMessageViewHolde } updateCurrentRemoteMessage(message); if (messageListener != null) { - messageListener.newMessageAdded(); + messageListener.onUpdateRemoteMessage(RttChatMessage.getLastIndexRemoteMessage(rttMessages)); } } |