Search in sources :

Example 1 with ArchivedConversationEvent

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

the class PendingConnectRequestManagerFragment method onOptionsItemClicked.

@Override
public void onOptionsItemClicked(IConversation conversation, User user, OptionsMenuItem item) {
    switch(item) {
        case BLOCK:
            showBlockUserConfirmation(user);
            break;
        case UNBLOCK:
            user.unblock();
            break;
        case ARCHIVE:
            getStoreFactory().getConversationStore().archive(conversation, true);
            ((BaseScalaActivity) getActivity()).injectJava(GlobalTrackingController.class).tagEvent(new ArchivedConversationEvent(conversation.getType().toString()));
            break;
        case UNARCHIVE:
            getStoreFactory().getConversationStore().archive(conversation, false);
            ((BaseScalaActivity) getActivity()).injectJava(GlobalTrackingController.class).tagEvent(new UnarchivedConversationEvent(conversation.getType().toString()));
            break;
        case SILENCE:
            conversation.setMuted(true);
            break;
        case UNSILENCE:
            conversation.setMuted(false);
            break;
    }
    optionsMenuControl.close();
}
Also used : GlobalTrackingController(com.waz.zclient.tracking.GlobalTrackingController) UnarchivedConversationEvent(com.waz.zclient.controllers.tracking.events.conversation.UnarchivedConversationEvent) ArchivedConversationEvent(com.waz.zclient.controllers.tracking.events.conversation.ArchivedConversationEvent)

Example 2 with ArchivedConversationEvent

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

the class ConversationListManagerFragment method onOptionsItemClicked.

@Override
public void onOptionsItemClicked(IConversation conversation, User user, OptionsMenuItem item) {
    switch(item) {
        case ARCHIVE:
            getStoreFactory().getConversationStore().archive(conversation, true);
            ((BaseScalaActivity) getActivity()).injectJava(GlobalTrackingController.class).tagEvent(new ArchivedConversationEvent(conversation.getType().toString()));
            break;
        case UNARCHIVE:
            getStoreFactory().getConversationStore().archive(conversation, false);
            ((BaseScalaActivity) getActivity()).injectJava(GlobalTrackingController.class).tagEvent(new UnarchivedConversationEvent(conversation.getType().toString()));
            break;
        case SILENCE:
            conversation.setMuted(true);
            break;
        case UNSILENCE:
            conversation.setMuted(false);
            break;
        case LEAVE:
            leaveConversation(conversation);
            break;
        case DELETE:
            deleteConversation(conversation);
            break;
        case BLOCK:
            showBlockConfirmation(user);
            break;
        case UNBLOCK:
            user.unblock();
            break;
        case CALL:
            callConversation(conversation);
            break;
        case PICTURE:
            sendPictureToConversation(conversation);
            break;
    }
    closeMenu();
}
Also used : GlobalTrackingController(com.waz.zclient.tracking.GlobalTrackingController) UnarchivedConversationEvent(com.waz.zclient.controllers.tracking.events.conversation.UnarchivedConversationEvent) ArchivedConversationEvent(com.waz.zclient.controllers.tracking.events.conversation.ArchivedConversationEvent)

Example 3 with ArchivedConversationEvent

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

the class ParticipantFragment method toggleArchiveConversation.

public void toggleArchiveConversation(final IConversation conversation, final boolean archive) {
    if (getStoreFactory().getConversationStore() != null) {
        getControllerFactory().getNavigationController().setVisiblePage(Page.CONVERSATION_LIST, TAG);
        getControllerFactory().getConversationScreenController().hideParticipants(false, true);
        new Handler().postDelayed(new Runnable() {

            @Override
            public void run() {
                if (getContainer() == null) {
                    return;
                }
                getStoreFactory().getConversationStore().archive(conversation, archive);
                if (getControllerFactory() == null || getControllerFactory().isTornDown()) {
                    return;
                }
                if (archive) {
                    ((BaseScalaActivity) getActivity()).injectJava(GlobalTrackingController.class).tagEvent(new ArchivedConversationEvent(conversation.getType().toString()));
                } else {
                    ((BaseScalaActivity) getActivity()).injectJava(GlobalTrackingController.class).tagEvent(new UnarchivedConversationEvent(conversation.getType().toString()));
                }
            }
        }, getResources().getInteger(R.integer.framework_animation_duration_medium));
    }
}
Also used : BaseScalaActivity(com.waz.zclient.BaseScalaActivity) Handler(android.os.Handler) UnarchivedConversationEvent(com.waz.zclient.controllers.tracking.events.conversation.UnarchivedConversationEvent) ArchivedConversationEvent(com.waz.zclient.controllers.tracking.events.conversation.ArchivedConversationEvent)

Aggregations

ArchivedConversationEvent (com.waz.zclient.controllers.tracking.events.conversation.ArchivedConversationEvent)3 UnarchivedConversationEvent (com.waz.zclient.controllers.tracking.events.conversation.UnarchivedConversationEvent)3 GlobalTrackingController (com.waz.zclient.tracking.GlobalTrackingController)2 Handler (android.os.Handler)1 BaseScalaActivity (com.waz.zclient.BaseScalaActivity)1