Search in sources :

Example 1 with ChatViewerFragment

use of com.xabber.android.ui.fragment.ChatViewerFragment in project xabber-android by redsolution.

the class ChatViewer method onContactsChanged.

@Override
public void onContactsChanged(Collection<BaseEntity> entities) {
    for (BaseEntity contact : entities) {
        for (ChatViewerFragment chat : registeredChats) {
            if (chat.isEqual(contact)) {
                chat.updateChat();
            }
        }
    }
    updateRegisteredRecentChatsFragments();
    updateStatusBar();
}
Also used : BaseEntity(com.xabber.android.data.entity.BaseEntity) ChatViewerFragment(com.xabber.android.ui.fragment.ChatViewerFragment)

Example 2 with ChatViewerFragment

use of com.xabber.android.ui.fragment.ChatViewerFragment in project xabber-android by redsolution.

the class ChatViewer method insertExtraText.

private void insertExtraText() {
    if (extraText == null) {
        return;
    }
    boolean isExtraTextInserted = false;
    for (ChatViewerFragment chat : registeredChats) {
        if (chat.isEqual(selectedChat)) {
            chat.setInputText(extraText);
            isExtraTextInserted = true;
        }
    }
    if (isExtraTextInserted) {
        extraText = null;
    }
}
Also used : ChatViewerFragment(com.xabber.android.ui.fragment.ChatViewerFragment)

Example 3 with ChatViewerFragment

use of com.xabber.android.ui.fragment.ChatViewerFragment in project xabber-android by redsolution.

the class ChatViewer method onChatChanged.

@Override
public void onChatChanged(final String account, final String user, final boolean incoming) {
    if (chatViewerAdapter.updateChats()) {
        chatScrollIndicatorAdapter.update(chatViewerAdapter.getActiveChats());
        selectPage();
    } else {
        for (ChatViewerFragment chat : registeredChats) {
            if (chat.isEqual(selectedChat)) {
                chat.updateChat();
                if (incoming) {
                    chat.playIncomingAnimation();
                }
            }
        }
        updateRegisteredRecentChatsFragments();
        updateStatusBar();
    }
}
Also used : ChatViewerFragment(com.xabber.android.ui.fragment.ChatViewerFragment)

Aggregations

ChatViewerFragment (com.xabber.android.ui.fragment.ChatViewerFragment)3 BaseEntity (com.xabber.android.data.entity.BaseEntity)1