@Override public void didReceivedNotification(int id, Object... args) { if (id == NotificationCenter.appDidLogout) { onFinish(); finish(); } else if (id == NotificationCenter.pushMessagesUpdated) { getNewMessage(); } else if (id == NotificationCenter.updateInterfaces) { if (currentMessageObject == null) { return; } int updateMask = (Integer) args[0]; if ((updateMask & MessagesController.UPDATE_MASK_NAME) != 0 || (updateMask & MessagesController.UPDATE_MASK_STATUS) != 0 || (updateMask & MessagesController.UPDATE_MASK_CHAT_NAME) != 0 || (updateMask & MessagesController.UPDATE_MASK_CHAT_MEMBERS) != 0) { updateSubtitle(); } if ((updateMask & MessagesController.UPDATE_MASK_AVATAR) != 0 || (updateMask & MessagesController.UPDATE_MASK_CHAT_AVATAR) != 0) { checkAndUpdateAvatar(); } if ((updateMask & MessagesController.UPDATE_MASK_USER_PRINT) != 0) { CharSequence printString = MessagesController.getInstance() .printingStrings .get(currentMessageObject.getDialogId()); if (lastPrintString != null && printString == null || lastPrintString == null && printString != null || lastPrintString != null && printString != null && !lastPrintString.equals(printString)) { updateSubtitle(); } } } else if (id == NotificationCenter.audioDidReset) { Integer mid = (Integer) args[0]; if (messageContainer != null) { int count = messageContainer.getChildCount(); for (int a = 0; a < count; a++) { View view = messageContainer.getChildAt(a); if ((Integer) view.getTag() == 3) { PopupAudioView cell = (PopupAudioView) view.findViewWithTag(300); if (cell.getMessageObject() != null && cell.getMessageObject().getId() == mid) { cell.updateButtonState(); break; } } } } } else if (id == NotificationCenter.audioProgressDidChanged) { Integer mid = (Integer) args[0]; if (messageContainer != null) { int count = messageContainer.getChildCount(); for (int a = 0; a < count; a++) { View view = messageContainer.getChildAt(a); if ((Integer) view.getTag() == 3) { PopupAudioView cell = (PopupAudioView) view.findViewWithTag(300); if (cell.getMessageObject() != null && cell.getMessageObject().getId() == mid) { cell.updateProgress(); break; } } } } } else if (id == NotificationCenter.emojiDidLoaded) { if (messageContainer != null) { int count = messageContainer.getChildCount(); for (int a = 0; a < count; a++) { View view = messageContainer.getChildAt(a); if ((Integer) view.getTag() == 1) { TextView textView = (TextView) view.findViewWithTag(301); if (textView != null) { textView.invalidate(); } } } } } else if (id == NotificationCenter.contactsDidLoaded) { updateSubtitle(); } }