use of net.iGap.realm.RealmChannelRoom in project iGap-Android by KianIranian-STDG.
the class FragmentChat method initMain.
private void initMain() {
HelperGetMessageState.clearMessageViews();
initPinedMessage();
viewMicRecorder = rootView.findViewById(R.id.layout_mic_recorde);
prgWaiting = rootView.findViewById(R.id.chl_prgWaiting);
AppUtils.setProgresColler(prgWaiting);
voiceRecord = new VoiceRecord(G.fragmentActivity, viewMicRecorder, viewAttachFile, this);
prgWaiting.setVisibility(View.VISIBLE);
txtEmptyMessages = rootView.findViewById(R.id.empty_messages);
if (isBot) {
txtEmptyMessages.setText(G.fragmentActivity.getResources().getString(R.string.empty_text_dr_bot));
txtChannelMute.setText(R.string.start);
iconChannelMute.setText("");
}
lastDateCalendar.clear();
locationManager = (LocationManager) G.fragmentActivity.getSystemService(LOCATION_SERVICE);
/**
* Hint: don't need to get info here. currently do this action in {{@link #startPageFastInitialize()}}
* Bundle extras = getArguments();
* if (extras != null) {
* mRoomId = extras.getLong("RoomId");
* isGoingFromUserLink = extras.getBoolean("GoingFromUserLink");
* isNotJoin = extras.getBoolean("ISNotJoin");
* userName = extras.getString("UserName");
* messageId = extras.getLong("MessageId");
* }
*/
/**
* get userId . use in chat set action.
*/
RealmUserInfo realmUserInfo = DbManager.getInstance().doRealmTask(realm -> {
return realm.where(RealmUserInfo.class).findFirst();
});
if (realmUserInfo == null) {
// finish();
finishChat();
return;
}
userId = realmUserInfo.getUserId();
managedRoom = getRoom();
if (managedRoom != null) {
// room exist
title = managedRoom.getTitle();
initialize = managedRoom.getInitials();
color = managedRoom.getColor();
isChatReadOnly = managedRoom.getReadOnly();
unreadCount = managedRoom.getUnreadCount();
savedScrollMessageId = managedRoom.getLastScrollPositionMessageId();
savedScrollDocumentId = managedRoom.getLastScrollPositionDocumentId();
firstVisiblePositionOffset = managedRoom.getLastScrollPositionOffset();
if (messageId != 0) {
savedScrollMessageId = messageId;
savedScrollDocumentId = documentId;
firstVisiblePositionOffset = 0;
}
if (chatType == CHAT) {
RealmRegisteredInfo realmRegisteredInfo = DbManager.getInstance().doRealmTask(realm -> {
return RealmRegisteredInfo.getRegistrationInfo(realm, chatPeerId);
});
if (realmRegisteredInfo != null) {
initialize = realmRegisteredInfo.getInitials();
color = realmRegisteredInfo.getColor();
phoneNumber = realmRegisteredInfo.getPhoneNumber();
if (realmRegisteredInfo.getId() == Config.drIgapPeerId) {
// if (realmRegisteredInfo.getUsername().equalsIgnoreCase("")) {
initDrBot();
}
} else {
title = managedRoom.getTitle();
initialize = managedRoom.getInitials();
color = managedRoom.getColor();
userStatus = G.fragmentActivity.getResources().getString(R.string.last_seen_recently);
}
} else if (chatType == GROUP) {
RealmGroupRoom realmGroupRoom = managedRoom.getGroupRoom();
groupRole = realmGroupRoom.getRole();
groupParticipantsCountLabel = realmGroupRoom.getParticipantsCountLabel();
} else if (chatType == CHANNEL) {
RealmChannelRoom realmChannelRoom = managedRoom.getChannelRoom();
channelRole = realmChannelRoom.getRole();
channelParticipantsCountLabel = realmChannelRoom.getParticipantsCountLabel();
}
} else {
// chatPeerId = extras.getLong("peerId");
chatType = CHAT;
RealmRegisteredInfo realmRegisteredInfo = DbManager.getInstance().doRealmTask(realm -> {
return RealmRegisteredInfo.getRegistrationInfo(realm, chatPeerId);
});
if (realmRegisteredInfo != null) {
title = realmRegisteredInfo.getDisplayName();
initialize = realmRegisteredInfo.getInitials();
color = realmRegisteredInfo.getColor();
lastSeen = realmRegisteredInfo.getLastSeen();
userStatus = realmRegisteredInfo.getStatus();
}
}
initComponent();
initAppbarSelected();
getDraft();
getUserInfo();
insertSharedData();
if (structIGSticker != null) {
G.handler.postDelayed(() -> sendStickerAsMessage(structIGSticker), 1000);
}
RealmRoomMessage rm = null;
RealmResults<RealmRoomMessage> result = DbManager.getInstance().doRealmTask(realm -> {
return realm.where(RealmRoomMessage.class).equalTo("roomId", mRoomId).findAll();
});
if (result.size() > 0) {
rm = result.last();
if (rm != null && rm.getMessage() != null) {
if (rm.getRealmAdditional() != null && (rm.getRealmAdditional().getAdditionalType() == Additional.WEB_VIEW.getAdditional())) {
String additionalData = rm.getRealmAdditional().getAdditionalData();
if (!additionalData.isEmpty())
openWebViewForSpecialUrlChat(additionalData);
}
}
}
FragmentShearedMedia.goToPositionFromShardMedia = new FragmentShearedMedia.GoToPositionFromShardMedia() {
@Override
public void goToPosition(Long messageId, long documentId) {
if (messageId != 0) {
savedScrollMessageId = messageId;
savedScrollDocumentId = documentId;
firstVisiblePositionOffset = 0;
if (goToPositionWithAnimation(savedScrollMessageId, 2000)) {
savedScrollMessageId = 0;
savedScrollDocumentId = 0;
} else {
RealmRoomMessage rm = DbManager.getInstance().doRealmTask(realm -> {
return realm.where(RealmRoomMessage.class).equalTo("messageId", messageId).findFirst();
});
rm = RealmRoomMessage.getFinalMessage(rm);
if (rm != null) {
resetMessagingValue();
savedScrollMessageId = FragmentChat.messageId = messageId;
savedScrollDocumentId = FragmentChat.documentId = documentId;
firstVisiblePositionOffset = 0;
getMessages();
}
}
}
}
};
sendChatTracker();
}
use of net.iGap.realm.RealmChannelRoom in project iGap-Android by KianIranian-STDG.
the class FragmentChat method onChatMessageSelectionChanged.
@Override
public void onChatMessageSelectionChanged(int selectedCount, Set<AbstractMessage> selectedItems) {
// TODO: 12/28/20 MESSAGE_REFACTOR
if (selectedCount > 0) {
// toolbar.setVisibility(View.GONE);
if (!isInSelectionMode) {
if (avatarItem != null) {
avatarItem.setVisibility(View.GONE);
}
if (muteIcon != null) {
muteIcon.setVisibility(View.GONE);
}
if (verifiedIcon != null) {
verifiedIcon.setVisibility(View.GONE);
}
createActionMode();
mToolbar.showActionToolbar();
AnimatorSet animatorSet = new AnimatorSet();
ArrayList<Animator> animators = new ArrayList<>();
for (int a = 0; a < actionModeViews.size(); a++) {
View view = actionModeViews.get(a);
view.setPivotY(Toolbar.getCurrentActionBarHeight() / 2);
animators.add(ObjectAnimator.ofFloat(view, View.SCALE_Y, 0.1f, 1.0f));
}
animatorSet.playTogether(animators);
animatorSet.setDuration(180);
animatorSet.start();
}
replyMessageItem.setVisibility(selectedCount > 1 ? View.GONE : View.VISIBLE);
multiSelectCounter.setNumber(selectedCount, true);
FragmentChat.isInSelectionMode = true;
isAllSenderId = true;
for (AbstractMessage message : selectedItems) {
RealmRoom realmRoom = getRoom();
if (realmRoom != null) {
if (chatType == CHANNEL) {
if (channelRole == ChannelChatRole.MEMBER) {
replyMessageItem.setVisibility(View.GONE);
deleteMessageItem.setVisibility(View.GONE);
isAllSenderId = false;
}
if (!RealmUserInfo.getCurrentUserAuthorHash().equals(message.messageObject.authorHash)) {
// if message dose'nt belong to owner
if (currentRoomAccess != null && currentRoomAccess.isCanDeleteMessage()) {
deleteMessageItem.setVisibility(View.VISIBLE);
} else {
deleteMessageItem.setVisibility(View.GONE);
}
} else {
deleteMessageItem.setVisibility(View.VISIBLE);
}
} else if (chatType == GROUP) {
if (!RealmUserInfo.getCurrentUserAuthorHash().equals(message.messageObject.authorHash)) {
// if message dose'nt belong to owner
if (currentRoomAccess != null && currentRoomAccess.isCanDeleteMessage()) {
deleteMessageItem.setVisibility(View.VISIBLE);
} else {
deleteMessageItem.setVisibility(View.GONE);
}
} else {
deleteMessageItem.setVisibility(View.VISIBLE);
}
} else if (realmRoom.getReadOnly()) {
replyMessageItem.setVisibility(View.GONE);
}
}
}
if (!isAllSenderId) {
deleteMessageItem.setVisibility(View.GONE);
}
showPopup(-1);
} else {
if (isInSelectionMode) {
mToolbar.hideActionToolbar();
if (avatarItem != null) {
avatarItem.setVisibility(View.VISIBLE);
}
if (muteIcon != null) {
muteIcon.setVisibility(getRoom().getMute() ? View.VISIBLE : View.GONE);
}
if (verifiedIcon != null) {
RealmChannelRoom channelRoom = getRoom().getChannelRoom();
boolean verified = false;
if (channelRoom != null) {
verified = channelRoom.isVerified();
}
verifiedIcon.setVisibility(verified ? View.VISIBLE : View.GONE);
}
}
FragmentChat.isInSelectionMode = false;
}
}
use of net.iGap.realm.RealmChannelRoom in project iGap-Android by KianIranian-STDG.
the class FragmentChat method onCreateView.
@Nullable
@Override
public View onCreateView(@NotNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
isNeedResume = true;
G.locationListener = this;
StickerRepository.getInstance().getUserStickersGroup();
notifyFrameLayout = new NotifyFrameLayout(context) {
@Override
public boolean dispatchKeyEventPreIme(KeyEvent event) {
if (event != null && event.getKeyCode() == KeyEvent.KEYCODE_BACK && event.getAction() == KeyEvent.ACTION_UP) {
if (topFragmentIsChat() && keyboardViewVisible) {
showPopup(-1);
return true;
}
return false;
}
return super.dispatchKeyEventPreIme(event);
}
};
Bundle extras = getArguments();
if (extras != null) {
mRoomId = extras.getLong("RoomId");
if (mustCheckPermission())
currentRoomAccess = DbManager.getInstance().doRealmTask(realm -> {
return realm.where(RealmRoomAccess.class).equalTo("id", mRoomId + "_" + AccountManager.getInstance().getCurrentUser().getId()).findFirst();
});
}
notifyFrameLayout.setListener(this::onScreenSizeChanged);
rootView = (FrameLayout) inflater.inflate(R.layout.fragment_chat, container, false);
chatContainer = rootView.findViewById(R.id.chatMainContainer);
mediaContainer = new FragmentMediaContainer(getActivity(), this);
mediaContainer.setListener(i -> {
switch(i) {
case FragmentMediaContainer.CALL_TAG:
getActivity().startActivity(new Intent(getContext(), CallActivity.class));
break;
case FragmentMediaContainer.MEDIA_TAG:
if (!MusicPlayer.isVoice) {
Intent intent = new Intent(context, ActivityMain.class);
intent.putExtra(ActivityMain.openMediaPlayer, true);
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
getActivity().startActivity(intent);
}
break;
case FragmentMediaContainer.PLAY_TAG:
break;
}
});
// mediaContainer.setVisibility(View.GONE);
chatContainer.addView(mediaContainer, LayoutCreator.createLinear(LayoutCreator.MATCH_PARENT, 39, Gravity.TOP | Gravity.LEFT, 0, 59, 0, 0));
mToolbar = new Toolbar(context);
searchFieldItem = mToolbar.addItem(searchFieldTag, R.string.icon_search, Theme.getInstance().getTitleTextColor(getContext())).setIsSearchBox(true).setActionBarMenuItemSearchListener(new ToolbarItem.ActionBarMenuItemSearchListener() {
int textLength;
@Override
public void onSearchExpand() {
if (layoutMute != null) {
layoutMute.setVisibility(View.GONE);
}
if (viewAttachFile != null) {
viewAttachFile.setVisibility(View.GONE);
}
if (rootView.findViewById(R.id.ac_ll_join).getVisibility() == View.VISIBLE) {
rootView.findViewById(R.id.ac_ll_join).setVisibility(View.GONE);
}
if (pinedMessageLayout != null) {
changePinnedMessageVisibility(true, false, MusicPlayer.isMusicPlyerEnable, CallManager.getInstance().isCallAlive());
}
if (vgSpamUser != null) {
vgSpamUser.setVisibility(View.GONE);
}
isSearchVisible = true;
}
@Override
public void onTextChanged(EditText editText) {
String text = editText.getText().toString();
if (text.length() > 0 && !text.startsWith("#")) {
if (!initHash) {
initHash = true;
initHashView();
}
searchHash.setHashString(editText.getText().toString());
searchHash.setPosition("");
if (searchFragment != null) {
searchFragment.onSearchCollapsed();
}
if (ll_navigateHash != null) {
ll_navigateHash.setVisibility(View.VISIBLE);
}
if (viewAttachFile != null) {
viewAttachFile.setVisibility(View.GONE);
}
} else if (text.startsWith("#") && text.length() < 2) {
if (text.length() > textLength) {
searchFragment = SearchFragment.newInstance(mRoomId, text, true);
getActivity().getSupportFragmentManager().beginTransaction().replace(R.id.chatContainer, searchFragment).commit();
}
if (keyboardContainer != null) {
keyboardContainer.setVisibility(View.GONE);
}
if (ll_navigateHash != null) {
ll_navigateHash.setVisibility(View.GONE);
}
if (txtFloatingTime != null) {
txtFloatingTime.setVisibility(View.GONE);
}
} else if (text.startsWith("#") && text.length() > 1) {
if (searchFragment != null && searchFragment.isAdded()) {
searchFragment.onTextChanged(editText.getText().toString());
}
} else {
hideKeyboardView();
if (ll_navigateHash != null) {
ll_navigateHash.setVisibility(View.GONE);
}
if (searchFragment != null && searchFragment.isAdded()) {
searchFragment.onSearchCollapsed();
}
}
textLength = editText.getText().length();
}
@Override
public void onSearchCollapse() {
if (muteIcon != null) {
muteIcon.setVisibility(getRoom().getMute() ? View.VISIBLE : View.GONE);
}
if (verifiedIcon != null) {
RealmChannelRoom channelRoom = getRoom().getChannelRoom();
boolean isVerified = false;
if (channelRoom != null) {
isVerified = channelRoom.isVerified();
}
verifiedIcon.setVisibility(isVerified ? View.VISIBLE : View.GONE);
}
if (avatarItem != null) {
avatarItem.setVisibility(View.VISIBLE);
}
if (pinedMessageLayout != null) {
if (isPinAvailable) {
changePinnedMessageVisibility(true, true, MusicPlayer.isMusicPlyerEnable, CallManager.getInstance().isCallAlive());
}
}
if (isNotJoin) {
rootView.findViewById(R.id.ac_ll_join).setVisibility(View.VISIBLE);
}
if (searchFragment != null) {
searchFragment.onSearchCollapsed();
}
if (vgSpamUser != null) {
showSpamBar();
}
goneSearchHashFooter();
hideKeyboardView();
searchFieldItem.setVisibility(View.GONE);
isSearchVisible = false;
}
});
searchFieldItem.setVisibility(View.GONE);
mToolbar.setOnClickListener(view -> {
hideKeyboard();
goToProfile();
});
mToolbar.setListener(i -> {
switch(i) {
case -1:
if (mToolbar.isActionModeShowed()) {
mAdapter.deselect();
return;
}
if (webViewChatPage != null) {
closeWebViewForSpecialUrlChat(false);
return;
}
hideKeyboard();
if (chatType == CHANNEL && !floatingHidden) {
if (channelRole == ChannelChatRole.OWNER && !isRecording) {
hideFloatingButton(true);
micAndAddStoryAnimateVisible(false);
}
return;
}
if (currentRoomAccess != null) {
if (currentRoomAccess != null) {
if (!currentRoomAccess.getRealmPostMessageRights().isCanSendText()) {
G.runOnUiThread(() -> {
viewAttachFile.setVisibility(View.GONE);
});
}
}
}
if (G.twoPaneMode) {
if (getActivity() instanceof ActivityMain) {
((ActivityMain) getActivity()).goToTabletEmptyPage();
}
} else {
if (!mToolbar.isSearchFieldVisible()) {
popBackStackFragment();
}
}
break;
case searchItem:
initLayoutSearchNavigation();
if (!initHash) {
initHash = true;
initHashView();
}
openSearchBox(null);
showPopup(KeyboardView.MODE_KEYBOARD);
G.handler.postDelayed(() -> editTextRequestFocus(searchEditText), 300);
break;
case voiceCallTag:
if (CallManager.getInstance().getCallPeerId() == chatPeerId) {
Intent activityIntent = new Intent(getActivity(), CallActivity.class);
activityIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
startActivity(activityIntent);
} else if (!CallManager.getInstance().isCallAlive()) {
CallSelectFragment selectFragment = CallSelectFragment.getInstance(chatPeerId, false, null);
if (getFragmentManager() != null)
selectFragment.show(getFragmentManager(), null);
if (keyboardViewVisible) {
hideKeyboard();
}
} else {
Toast.makeText(getContext(), "NOT ALLOWED", Toast.LENGTH_SHORT).show();
}
break;
case moreTag:
createMoreItems();
break;
case clearHistoryItem:
new MaterialDialog.Builder(G.fragmentActivity).title(R.string.clear_history).content(R.string.clear_history_content).positiveText(R.string.yes).onPositive((dialog, which) -> clearHistory(mRoomId)).negativeText(R.string.no).show();
break;
case deleteItem:
new MaterialDialog.Builder(G.fragmentActivity).title(R.string.delete_chat).content(R.string.delete_chat_content).positiveText(R.string.yes).onPositive((dialog, which) -> deleteChat(mRoomId)).negativeText(R.string.no).show();
break;
case muteItem:
case unMuteItem:
muteNotification(mRoomId);
break;
case chatToGroupItem:
new MaterialDialog.Builder(G.fragmentActivity).title(R.string.convert_chat_to_group_title).content(R.string.convert_chat_to_group_content).positiveText(R.string.yes).negativeText(R.string.no).onPositive((dialog, which) -> {
// finish();
finishChat();
dialog.dismiss();
G.handler.post(() -> G.onConvertToGroup.openFragmentOnActivity("ConvertToGroup", mRoomId));
}).show();
break;
case cleanUpItem:
resetMessagingValue();
setDownBtnGone();
setCountNewMessageZero();
DbManager.getInstance().doRealmTask(realm -> {
RealmRoomMessage.ClearAllMessageRoomAsync(realm, mRoomId, () -> {
recyclerView.addOnScrollListener(scrollListener);
saveMessageIdPositionState(0, 0);
/**
* get history from server
*/
topMore = true;
getOnlineMessage(0, 0, UP);
});
});
break;
case reportItem:
dialogReport(false, 0, 0);
break;
case sendMoneyItem:
showPaymentDialog();
break;
case exportChatItem:
if (HelperPermission.grantedUseStorage()) {
exportChat();
} else {
try {
HelperPermission.getStoragePermission(G.fragmentActivity, new OnGetPermission() {
@Override
public void Allow() {
exportChat();
}
@Override
public void deny() {
Toast.makeText(G.currentActivity, R.string.export_message, Toast.LENGTH_SHORT).show();
}
});
} catch (IOException e) {
e.printStackTrace();
}
}
break;
case stopItem:
new MaterialDialog.Builder(G.fragmentActivity).title(R.string.stop).content(R.string.stop_message_bot).positiveText(R.string.yes).onPositive((dialog, which) -> {
// onSelectRoomMenu("txtClearHistory", mRoomId);
closeWebViewForSpecialUrlChat(true);
// popBackStackFragment();
}).negativeText(R.string.no).show();
break;
case copyMessageTag:
copySelectedItemTextToClipboard();
break;
case forwardMessageTag:
// forward selected messages to room list for selecting room
if (mAdapter != null && mAdapter.getSelectedItems().size() > 0) {
onForwardClick(null);
}
break;
case replyMessageTag:
if (mAdapter != null && !mAdapter.getSelectedItems().isEmpty() && mAdapter.getSelectedItems().size() == 1) {
reply(mAdapter.getSelectedItems().iterator().next().messageObject, false);
}
break;
case deleteMessageTag:
messageIds = new ArrayList<>();
documentIds = new ArrayList<>();
bothDeleteMessageId = new ArrayList<>();
G.handler.post(() -> {
for (final AbstractMessage item : mAdapter.getSelectedItems()) {
if (mAdapter.getSelectedItems().size() == 1) {
confirmAndDeleteMessage(item.messageObject, true);
return;
}
try {
if (item != null && item.messageObject != null) {
Long messageId = item.messageObject.id;
Long documentId = item.messageObject.documentId;
messageIds.add(messageId);
documentIds.add(documentId);
boolean bothDelete = RealmRoomMessage.isBothDelete(item.messageObject.getUpdateOrCreateTime());
if (bothDelete)
bothDeleteMessageId.add(messageId);
}
} catch (NullPointerException e) {
e.printStackTrace();
}
}
if (chatType == CHAT && !isCloudRoom && bothDeleteMessageId.size() > 0 && mAdapter.getSelectedItems().iterator().next().messageObject.userId == AccountManager.getInstance().getCurrentUser().getId()) {
String delete;
String textCheckBox = getContext().getResources().getString(R.string.st_checkbox_delete) + " " + title;
delete = getContext().getResources().getString(R.string.st_desc_deletes);
new MaterialDialog.Builder(getContext()).content(delete).title(R.string.message).positiveText(R.string.ok).negativeText(R.string.cancel).onPositive((dialog, which) -> {
if (!dialog.isPromptCheckBoxChecked()) {
bothDeleteMessageId = null;
}
getMessageController().deleteSelectedMessage(chatType.getNumber(), mRoomId, messageIds, documentIds, bothDeleteMessageId);
// deleteSelectedMessageFromAdapter(messageIds);
}).checkBoxPrompt(textCheckBox, false, null).show();
} else {
new MaterialDialog.Builder(getActivity()).title(R.string.message).content(getActivity().getResources().getString(R.string.st_desc_deletes)).positiveText(R.string.ok).negativeText(R.string.cancel).onPositive((dialog, which) -> {
bothDeleteMessageId = null;
getMessageController().deleteSelectedMessage(chatType.getNumber(), mRoomId, messageIds, documentIds, bothDeleteMessageId);
// deleteSelectedMessageFromAdapter(messageIds);
}).show();
}
});
break;
}
});
searchEditText = searchFieldItem.getSearchEditText();
mToolbar.setBackIcon(new BackDrawable(false));
verifiedIcon = mToolbar.addVerifiedChannelsIcon();
muteIcon = mToolbar.addMuteIcon();
ToolbarItems toolbarItems = mToolbar.createToolbarItems();
toolbarItems.setBackground(null);
moreItem = toolbarItems.addItemWithWidth(moreTag, R.string.icon_other_vertical_dots, 48);
callItem = toolbarItems.addItemWithWidth(voiceCallTag, R.string.icon_voice_call, 48);
createActionMode();
rootView.addView(mToolbar, LayoutCreator.createFrame(LayoutCreator.MATCH_PARENT, 60, Gravity.TOP));
notifyFrameLayout.addView(rootView, LayoutCreator.createFrame(LayoutCreator.MATCH_PARENT, LayoutCreator.MATCH_PARENT));
keyboardContainer = rootView.findViewById(R.id.fl_chat_keyboardContainer);
sendMoney = rootView.findViewById(R.id.btn_chatRoom_wallet);
/**
* init chat box edit text and send item because we need change this color in dark mode!
*/
edtChat = rootView.findViewById(R.id.et_chatRoom_writeMessage);
edtChat.setGravity(Gravity.CENTER_VERTICAL);
edtChat.setListener(this::chatMotionEvent);
imvSendButton = rootView.findViewById(R.id.btn_chatRoom_send);
editTextProgress = rootView.findViewById(R.id.editTextProgress);
chatRoom_send_container = rootView.findViewById(R.id.chatRoom_send_container);
getEventManager().addObserver(EventManager.CALL_STATE_CHANGED, this);
getEventManager().addObserver(EventManager.EMOJI_LOADED, this);
getEventManager().addObserver(EventManager.ON_MESSAGE_DELETE, this);
getEventManager().addObserver(EventManager.ON_EDIT_MESSAGE, this);
getEventManager().addObserver(EventManager.ON_PINNED_MESSAGE, this);
getEventManager().addObserver(EventManager.CHAT_CLEAR_MESSAGE, this);
getEventManager().addObserver(EventManager.CHANNEL_ADD_VOTE, this);
getEventManager().addObserver(EventManager.CHANNEL_GET_VOTE, this);
getEventManager().addObserver(EventManager.CHANNEL_UPDATE_VOTE, this);
getEventManager().addObserver(EventManager.CHANNEL_UPDATE_VOTE, this);
getEventManager().addObserver(EventManager.CHAT_UPDATE_STATUS, this);
getEventManager().addObserver(EventManager.MEDIA_PLAYER_STATE_CHANGED, this);
getEventManager().addObserver(EventManager.NEXT_VOICE, this);
getEventManager().addObserver(EventManager.ON_FILE_PICKED_FROM_INTENT, this);
if (twoPaneMode)
EventManager.getInstance(AccountManager.selectedAccount).addObserver(EventManager.CHAT_BACKGROUND_CHANGED, this);
return attachToSwipeBack(notifyFrameLayout);
}
Aggregations