Fixed history display issue
This commit is contained in:
parent
3f65e2dc8c
commit
d0ca028ebe
1 changed files with 9 additions and 20 deletions
|
@ -824,18 +824,7 @@ public class ChatMessagesFragment extends Fragment
|
||||||
|
|
||||||
private void displayChatRoomHistory() {
|
private void displayChatRoomHistory() {
|
||||||
if (mChatRoom == null) return;
|
if (mChatRoom == null) return;
|
||||||
ChatMessagesAdapter mEventsAdapter;
|
ChatMessagesAdapter mEventsAdapter =
|
||||||
if (mChatRoom.hasCapability(ChatRoomCapabilities.OneToOne.toInt())) {
|
|
||||||
mEventsAdapter =
|
|
||||||
new ChatMessagesAdapter(
|
|
||||||
this,
|
|
||||||
mSelectionHelper,
|
|
||||||
R.layout.chat_bubble,
|
|
||||||
mChatRoom.getHistoryMessageEvents(MESSAGES_PER_PAGE),
|
|
||||||
mParticipants,
|
|
||||||
this);
|
|
||||||
} else {
|
|
||||||
mEventsAdapter =
|
|
||||||
new ChatMessagesAdapter(
|
new ChatMessagesAdapter(
|
||||||
this,
|
this,
|
||||||
mSelectionHelper,
|
mSelectionHelper,
|
||||||
|
@ -843,7 +832,6 @@ public class ChatMessagesFragment extends Fragment
|
||||||
mChatRoom.getHistoryEvents(MESSAGES_PER_PAGE),
|
mChatRoom.getHistoryEvents(MESSAGES_PER_PAGE),
|
||||||
mParticipants,
|
mParticipants,
|
||||||
this);
|
this);
|
||||||
}
|
|
||||||
mSelectionHelper.setAdapter(mEventsAdapter);
|
mSelectionHelper.setAdapter(mEventsAdapter);
|
||||||
mChatEventsList.setAdapter(mEventsAdapter);
|
mChatEventsList.setAdapter(mEventsAdapter);
|
||||||
scrollToBottom();
|
scrollToBottom();
|
||||||
|
@ -1388,6 +1376,7 @@ public class ChatMessagesFragment extends Fragment
|
||||||
@Override
|
@Override
|
||||||
public void onEphemeralEvent(ChatRoom chatRoom, EventLog eventLog) {
|
public void onEphemeralEvent(ChatRoom chatRoom, EventLog eventLog) {
|
||||||
((ChatMessagesGenericAdapter) mChatEventsList.getAdapter()).addToHistory(eventLog);
|
((ChatMessagesGenericAdapter) mChatEventsList.getAdapter()).addToHistory(eventLog);
|
||||||
|
scrollToBottom();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
Loading…
Reference in a new issue