Search in sources :

Example 1 with StartedRecordingAudioMessageEvent

use of com.waz.zclient.core.controllers.tracking.events.media.StartedRecordingAudioMessageEvent in project wire-android by wireapp.

the class ConversationFragment method onAudioMessageRecordingStarted.

@Override
public void onAudioMessageRecordingStarted() {
    getControllerFactory().getGlobalLayoutController().keepScreenAwake();
    ((BaseScalaActivity) getActivity()).injectJava(GlobalTrackingController.class).tagEvent(new StartedRecordingAudioMessageEvent(getConversationTypeString(), false));
}
Also used : StartedRecordingAudioMessageEvent(com.waz.zclient.core.controllers.tracking.events.media.StartedRecordingAudioMessageEvent) GlobalTrackingController(com.waz.zclient.tracking.GlobalTrackingController)

Example 2 with StartedRecordingAudioMessageEvent

use of com.waz.zclient.core.controllers.tracking.events.media.StartedRecordingAudioMessageEvent in project wire-android by wireapp.

the class ConversationFragment method onCursorButtonLongPressed.

@Override
public void onCursorButtonLongPressed(CursorMenuItem cursorMenuItem) {
    switch(cursorMenuItem) {
        case AUDIO_MESSAGE:
            if (PermissionUtils.hasSelfPermissions(getActivity(), AUDIO_PERMISSION)) {
                extendedCursorContainer.close(true);
                if (audioMessageRecordingView.getVisibility() == View.VISIBLE) {
                    break;
                }
                SoundController ctrl = inject(SoundController.class);
                if (ctrl != null) {
                    ctrl.shortVibrate();
                }
                audioMessageRecordingView.prepareForRecording();
                audioMessageRecordingView.setVisibility(View.VISIBLE);
                final IConversation conversation = getStoreFactory().getConversationStore().getCurrentConversation();
                ((BaseScalaActivity) getActivity()).injectJava(GlobalTrackingController.class).tagEvent(OpenedMediaActionEvent.cursorAction(OpenedMediaAction.AUDIO_MESSAGE, conversation));
                ((BaseScalaActivity) getActivity()).injectJava(GlobalTrackingController.class).tagEvent(new StartedRecordingAudioMessageEvent(getConversationTypeString(), true));
            } else {
                ActivityCompat.requestPermissions(getActivity(), AUDIO_PERMISSION, AUDIO_PERMISSION_REQUEST_ID);
            }
            break;
    }
}
Also used : SoundController(com.waz.zclient.media.SoundController) StartedRecordingAudioMessageEvent(com.waz.zclient.core.controllers.tracking.events.media.StartedRecordingAudioMessageEvent) GlobalTrackingController(com.waz.zclient.tracking.GlobalTrackingController) IConversation(com.waz.api.IConversation)

Aggregations

StartedRecordingAudioMessageEvent (com.waz.zclient.core.controllers.tracking.events.media.StartedRecordingAudioMessageEvent)2 GlobalTrackingController (com.waz.zclient.tracking.GlobalTrackingController)2 IConversation (com.waz.api.IConversation)1 SoundController (com.waz.zclient.media.SoundController)1