Commit a26b1857 authored by Grigory Fedorov's avatar Grigory Fedorov

ChatViewer: Chat fragments updated only if they need to be updated...

ChatViewer: Chat fragments updated only if they need to be updated (onChatChanged, onContactsChanged)
parent 2075538c
......@@ -356,21 +356,29 @@ public class ChatViewer extends ManagedActivity implements OnChatChangedListener
chatScrollIndicatorAdapter.update(chatViewerAdapter.getActiveChats());
selectPage();
} else {
updateRegisteredChats();
updateRegisteredRecentChatsFragments();
updateStatusBar();
for (ChatViewerFragment chat : registeredChats) {
if (chat.isEqual(selectedChat) && incoming) {
chat.playIncomingAnimation();
if (chat.isEqual(selectedChat)) {
chat.updateChat();
if (incoming) {
chat.playIncomingAnimation();
}
}
}
updateRegisteredRecentChatsFragments();
updateStatusBar();
}
}
@Override
public void onContactsChanged(Collection<BaseEntity> entities) {
updateRegisteredChats();
for (BaseEntity contact : entities) {
for (ChatViewerFragment chat : registeredChats) {
if (chat.isEqual(contact)) {
chat.updateChat();
}
}
}
updateRegisteredRecentChatsFragments();
updateStatusBar();
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment