Search in sources :

Example 1 with MainThreadExecutor

use of com.fanap.podchat.chat.MainThreadExecutor in project pod-chat-android-sdk by FanapSoft.

the class CallPresenter method onCallParticipantStoppedScreenSharing.

@Override
public void onCallParticipantStoppedScreenSharing(ChatResponse<ScreenShareResult> response) {
    if (cpvManager != null) {
        MainThreadExecutor exec = new MainThreadExecutor();
        exec.execute(() -> cpvManager.releaseScreenShareView());
    } else
        view.onCallParticipantStoppedScreenSharing();
}
Also used : MainThreadExecutor(com.fanap.podchat.chat.MainThreadExecutor)

Example 2 with MainThreadExecutor

use of com.fanap.podchat.chat.MainThreadExecutor in project pod-chat-android-sdk by FanapSoft.

the class CallPresenter method onCallParticipantStartedVideo.

@Override
public void onCallParticipantStartedVideo(ChatResponse<JoinCallParticipantResult> response) {
    try {
        if (cpvManager != null) {
            CallParticipantVO callParticipant = response.getResult().getJoinedParticipants().get(0);
            new MainThreadExecutor().execute(() -> {
                try {
                    Objects.requireNonNull(cpvManager.getPartnerAssignedView(callParticipant.getUserId())).setVisibility(View.VISIBLE);
                    cpvManager.showPartnerName(callParticipant.getUserId(), callParticipant.getParticipantVO().getName());
                } catch (Exception e) {
                    e.printStackTrace();
                }
            });
        }
        view.showMessage(response.getResult().getJoinedParticipants().get(0).getParticipantVO().getName() + " الان تصویر داره!");
    } catch (Exception e) {
        view.onError(e.getMessage());
    }
}
Also used : CallParticipantVO(com.fanap.podchat.call.model.CallParticipantVO) MainThreadExecutor(com.fanap.podchat.chat.MainThreadExecutor)

Aggregations

MainThreadExecutor (com.fanap.podchat.chat.MainThreadExecutor)2 CallParticipantVO (com.fanap.podchat.call.model.CallParticipantVO)1