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 ...@@ -356,21 +356,29 @@ public class ChatViewer extends ManagedActivity implements OnChatChangedListener
chatScrollIndicatorAdapter.update(chatViewerAdapter.getActiveChats()); chatScrollIndicatorAdapter.update(chatViewerAdapter.getActiveChats());
selectPage(); selectPage();
} else { } else {
updateRegisteredChats();
updateRegisteredRecentChatsFragments();
updateStatusBar();
for (ChatViewerFragment chat : registeredChats) { for (ChatViewerFragment chat : registeredChats) {
if (chat.isEqual(selectedChat) && incoming) { if (chat.isEqual(selectedChat)) {
chat.updateChat();
if (incoming) {
chat.playIncomingAnimation(); chat.playIncomingAnimation();
} }
} }
} }
updateRegisteredRecentChatsFragments();
updateStatusBar();
}
} }
@Override @Override
public void onContactsChanged(Collection<BaseEntity> entities) { public void onContactsChanged(Collection<BaseEntity> entities) {
updateRegisteredChats(); for (BaseEntity contact : entities) {
for (ChatViewerFragment chat : registeredChats) {
if (chat.isEqual(contact)) {
chat.updateChat();
}
}
}
updateRegisteredRecentChatsFragments(); updateRegisteredRecentChatsFragments();
updateStatusBar(); 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