use of com.waz.api.IConversation in project wire-android by wireapp.
the class ConversationManagerFragment method onSelectedUsers.
@Override
public void onSelectedUsers(List<User> users, ConversationChangeRequester requester) {
// TODO https://wearezeta.atlassian.net/browse/AN-3730
getControllerFactory().getPickUserController().hidePickUser(getCurrentPickerDestination(), false);
IConversation currentConversation = getStoreFactory().getConversationStore().getCurrentConversation();
if (currentConversation.getType() == IConversation.Type.ONE_TO_ONE) {
getStoreFactory().getConversationStore().createGroupConversation(users, requester);
if (!getStoreFactory().getNetworkStore().hasInternetConnection()) {
ViewUtils.showAlertDialog(getActivity(), R.string.conversation__create_group_conversation__no_network__title, R.string.conversation__create_group_conversation__no_network__message, R.string.conversation__create_group_conversation__no_network__button, null, true);
}
((BaseScalaActivity) getActivity()).injectJava(GlobalTrackingController.class).tagEvent(new CreatedGroupConversationEvent(true, (users.size() + 1)));
} else if (currentConversation.getType() == IConversation.Type.GROUP) {
currentConversation.addMembers(users);
if (!getStoreFactory().getNetworkStore().hasInternetConnection()) {
ViewUtils.showAlertDialog(getActivity(), R.string.conversation__add_user__no_network__title, R.string.conversation__add_user__no_network__message, R.string.conversation__add_user__no_network__button, null, true);
}
((BaseScalaActivity) getActivity()).injectJava(GlobalTrackingController.class).tagEvent(new AddedMemberToGroupEvent(getParticipantsCount(), users.size()));
}
}
use of com.waz.api.IConversation in project wire-android by wireapp.
the class ConversationFragment method openExtendedCursor.
private void openExtendedCursor(ExtendedCursorContainer.Type type) {
final IConversation conversation = getStoreFactory().getConversationStore().getCurrentConversation();
switch(type) {
case NONE:
break;
case VOICE_FILTER_RECORDING:
extendedCursorContainer.openVoiceFilter(this);
hideSendButtonIfNeeded();
((BaseScalaActivity) getActivity()).injectJava(GlobalTrackingController.class).tagEvent(OpenedMediaActionEvent.cursorAction(OpenedMediaAction.AUDIO_MESSAGE, conversation));
break;
case IMAGES:
extendedCursorContainer.openCursorImages(this);
hideSendButtonIfNeeded();
((BaseScalaActivity) getActivity()).injectJava(GlobalTrackingController.class).tagEvent(OpenedMediaActionEvent.cursorAction(OpenedMediaAction.PHOTO, conversation));
break;
}
}
use of com.waz.api.IConversation in project wire-android by wireapp.
the class ConversationFragment method onEphemeralButtonClicked.
@Override
public void onEphemeralButtonClicked(EphemeralExpiration currentEphemeralExpiration) {
extendedCursorContainer.openEphemeral(this, currentEphemeralExpiration);
if (currentEphemeralExpiration == EphemeralExpiration.NONE) {
IConversation conversation = getStoreFactory().getConversationStore().getCurrentConversation();
((BaseScalaActivity) getActivity()).injectJava(GlobalTrackingController.class).tagEvent(OpenedMediaActionEvent.ephemeral(conversation, false));
}
}
use of com.waz.api.IConversation in project wire-android by wireapp.
the class TabbedParticipantBodyFragment method updateViews.
private void updateViews(User user) {
if (viewPager == null) {
return;
}
View view = viewPager.findViewWithTag(TabbedParticipantPagerAdapter.ParticipantTabs.DETAILS);
if (view instanceof ParticipantDetailsTab) {
ParticipantDetailsTab tab = (ParticipantDetailsTab) view;
tab.setUser(user);
final IConversation conversation = getStoreFactory().getConversationStore().getCurrentConversation();
if (conversation != null) {
if (conversation.getType() == IConversation.Type.ONE_TO_ONE) {
tab.updateFooterMenu(R.string.glyph__add_people, R.string.conversation__action__create_group, R.string.glyph__more, R.string.empty_string, callbacks);
} else {
tab.updateFooterMenu(R.string.glyph__conversation, R.string.empty_string, R.string.glyph__minus, R.string.empty_string, callbacks);
}
}
}
}
use of com.waz.api.IConversation in project wire-android by wireapp.
the class TabbedParticipantBodyFragment method updateUser.
private void updateUser() {
IConversation conversation = getStoreFactory().getConversationStore().getCurrentConversation();
if (conversation == null) {
userModelObserver.clear();
userModelObserverForTabs.clear();
otrClientsModelObserver.clear();
return;
}
User updatedUser;
if (conversation.getType() == IConversation.Type.ONE_TO_ONE) {
updatedUser = conversation.getOtherParticipant();
} else {
updatedUser = getStoreFactory().getSingleParticipantStore().getUser();
}
userModelObserver.setAndUpdate(updatedUser);
userModelObserverForTabs.setAndUpdate(updatedUser);
}
Aggregations