Search in sources :

Example 1 with CreatedGroupConversationEvent

use of com.waz.zclient.controllers.tracking.events.group.CreatedGroupConversationEvent in project wire-android by wireapp.

the class ConversationListManagerFragment method onSelectedUsers.

//////////////////////////////////////////////////////////////////////////////////////////
//
//  PickUserFragment.Container
//
//////////////////////////////////////////////////////////////////////////////////////////
@Override
public void onSelectedUsers(List<User> users, ConversationChangeRequester requester) {
    // TODO https://wearezeta.atlassian.net/browse/AN-3730
    getControllerFactory().getPickUserController().hidePickUser(getCurrentPickerDestination(), true);
    if (users.size() == 1) {
        User user = users.get(0);
        IConversation conversation = user.getConversation();
        if (conversation != null) {
            getStoreFactory().getConversationStore().setCurrentConversation(conversation, requester);
        }
        ((BaseScalaActivity) getActivity()).injectJava(GlobalTrackingController.class).tagEvent(new OpenedConversationEvent(ConversationType.ONE_TO_ONE_CONVERSATION.name()));
    } else {
        getStoreFactory().getConversationStore().createGroupConversation(users, requester);
        ((BaseScalaActivity) getActivity()).injectJava(GlobalTrackingController.class).tagEvent(new CreatedGroupConversationEvent(false, (users.size() + 1)));
        ((BaseScalaActivity) getActivity()).injectJava(GlobalTrackingController.class).tagEvent(new OpenedConversationEvent(ConversationType.GROUP_CONVERSATION.name()));
    }
}
Also used : CreatedGroupConversationEvent(com.waz.zclient.controllers.tracking.events.group.CreatedGroupConversationEvent) User(com.waz.api.User) GlobalTrackingController(com.waz.zclient.tracking.GlobalTrackingController) OpenedConversationEvent(com.waz.zclient.controllers.tracking.events.connect.OpenedConversationEvent) IConversation(com.waz.api.IConversation)

Example 2 with CreatedGroupConversationEvent

use of com.waz.zclient.controllers.tracking.events.group.CreatedGroupConversationEvent 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()));
    }
}
Also used : CreatedGroupConversationEvent(com.waz.zclient.controllers.tracking.events.group.CreatedGroupConversationEvent) GlobalTrackingController(com.waz.zclient.tracking.GlobalTrackingController) BaseScalaActivity(com.waz.zclient.BaseScalaActivity) IConversation(com.waz.api.IConversation) AddedMemberToGroupEvent(com.waz.zclient.controllers.tracking.events.group.AddedMemberToGroupEvent)

Example 3 with CreatedGroupConversationEvent

use of com.waz.zclient.controllers.tracking.events.group.CreatedGroupConversationEvent in project wire-android by wireapp.

the class ParticipantsDialogFragment 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()));
    }
    hide();
}
Also used : CreatedGroupConversationEvent(com.waz.zclient.controllers.tracking.events.group.CreatedGroupConversationEvent) GlobalTrackingController(com.waz.zclient.tracking.GlobalTrackingController) BaseScalaActivity(com.waz.zclient.BaseScalaActivity) IConversation(com.waz.api.IConversation) AddedMemberToGroupEvent(com.waz.zclient.controllers.tracking.events.group.AddedMemberToGroupEvent)

Example 4 with CreatedGroupConversationEvent

use of com.waz.zclient.controllers.tracking.events.group.CreatedGroupConversationEvent in project wire-android by wireapp.

the class ParticipantFragment method onSelectedUsers.

//////////////////////////////////////////////////////////////////////////////////////////
//
//  PickUserFragment.Container
//
//////////////////////////////////////////////////////////////////////////////////////////
@Override
public void onSelectedUsers(List<User> users, ConversationChangeRequester requester) {
    IConversation currentConversation = getStoreFactory().getConversationStore().getCurrentConversation();
    if (currentConversation.getType() == IConversation.Type.ONE_TO_ONE) {
        getControllerFactory().getPickUserController().hidePickUser(getCurrentPickerDestination(), false);
        dismissDialog();
        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);
        getControllerFactory().getPickUserController().hidePickUser(getCurrentPickerDestination(), false);
        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()));
    }
}
Also used : CreatedGroupConversationEvent(com.waz.zclient.controllers.tracking.events.group.CreatedGroupConversationEvent) GlobalTrackingController(com.waz.zclient.tracking.GlobalTrackingController) BaseScalaActivity(com.waz.zclient.BaseScalaActivity) IConversation(com.waz.api.IConversation) AddedMemberToGroupEvent(com.waz.zclient.controllers.tracking.events.group.AddedMemberToGroupEvent)

Aggregations

IConversation (com.waz.api.IConversation)4 CreatedGroupConversationEvent (com.waz.zclient.controllers.tracking.events.group.CreatedGroupConversationEvent)4 GlobalTrackingController (com.waz.zclient.tracking.GlobalTrackingController)4 BaseScalaActivity (com.waz.zclient.BaseScalaActivity)3 AddedMemberToGroupEvent (com.waz.zclient.controllers.tracking.events.group.AddedMemberToGroupEvent)3 User (com.waz.api.User)1 OpenedConversationEvent (com.waz.zclient.controllers.tracking.events.connect.OpenedConversationEvent)1