use of com.fanap.podcall.view.CallPartnerView in project pod-chat-android-sdk by FanapSoft.
the class CallPresenter method onCallParticipantStoppedVideo.
@Override
public void onCallParticipantStoppedVideo(ChatResponse<JoinCallParticipantResult> response) {
try {
view.showMessage(response.getResult().getJoinedParticipants().get(0).getParticipantVO().getName() + " دوربینش رو بست! ");
if (cpvManager != null) {
activity.runOnUiThread(() -> cpvManager.releasePartnerView(response.getResult().getJoinedParticipants().get(0).getUserId()));
return;
}
CallPartnerView pw = findParticipantView(response.getResult().getJoinedParticipants().get(0).getUserId());
activity.runOnUiThread(() -> {
if (pw != null) {
pw.setPartnerName("");
pw.setPartnerId(0L);
pw.reset();
pw.setVisibility(View.GONE);
chat.addPartnerView(pw, 0);
}
});
} catch (Exception e) {
view.onError(e.getMessage());
}
}
use of com.fanap.podcall.view.CallPartnerView in project pod-chat-android-sdk by FanapSoft.
the class CallPresenter method onCallPartnerViewSelected.
@Override
public void onCallPartnerViewSelected(CallPartnerView secondPartnerView) {
if (isInCall) {
CallPartnerView mainPartnerView = remotePartnersViews.get(0);
Long mainPartnerId = mainPartnerView.getPartnerId();
Long secondPartnerId = secondPartnerView.getPartnerId();
SwapViewsRequest request = new SwapViewsRequest.Builder().setFirstPartnerUserId(mainPartnerId).setSecondPartnerUserId(secondPartnerId).setFirstPartnerView(mainPartnerView).setSecondPartnerView(secondPartnerView).build();
chat.swapPartnerViews(request);
}
}
use of com.fanap.podcall.view.CallPartnerView in project pod-chat-android-sdk by FanapSoft.
the class CallPartnerViewPool method generatePartnerView.
private CallPartnerView generatePartnerView(long partnerUserId) {
CallPartnerView newPartnerView = null;
try {
checkIsListInitialized();
if (isOnMaximumNumberOfViews(partnerUserId))
return null;
newPartnerView = new CallPartnerView(getContextFromPartnerView());
newPartnerView.setPartnerId(partnerUserId);
addView(newPartnerView);
checkIsMapInitialized();
getValidUserIdToViewMap().put(partnerUserId, newPartnerView);
callOnNewViewGenerated(newPartnerView);
} catch (Exception e) {
e.printStackTrace();
}
return newPartnerView;
}
use of com.fanap.podcall.view.CallPartnerView in project pod-chat-android-sdk by FanapSoft.
the class CallPartnerViewPool method generatePartnerView.
private CallPartnerView generatePartnerView() {
CallPartnerView newPartnerView = null;
try {
newPartnerView = new CallPartnerView(getContextFromPartnerView());
checkIsListInitialized();
addView(newPartnerView);
callOnNewViewGenerated(newPartnerView);
} catch (Exception e) {
e.printStackTrace();
}
return newPartnerView;
}
use of com.fanap.podcall.view.CallPartnerView in project pod-chat-android-sdk by FanapSoft.
the class CallPartnerViewPool method setPartnerView.
@Override
public boolean setPartnerView(Long partnerUserId, CallPartnerView newView) {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
if (Objects.equals(partnerUserId, NOT_ASSIGNED) || partnerUserId < 0)
return false;
} else {
if (partnerUserId.equals(NOT_ASSIGNED) || partnerUserId < 0)
return false;
}
checkIsMapInitialized();
CallPartnerView lastView = getPartnerAssignedView(partnerUserId);
if (lastView != null) {
lastView.setPartnerId(CallPartnerViewPool.NOT_ASSIGNED);
lastView.setPartnerName("");
lastView.setDisplayName(false);
lastView.setDisplayIsMuteIcon(false);
lastView.setDisplayCameraIsOffIcon(false);
}
Long newViewLastPartnerUserId = newView.getPartnerId();
if (!newViewLastPartnerUserId.equals(NOT_ASSIGNED)) {
getValidUserIdToViewMap().remove(newViewLastPartnerUserId);
}
visibleView(newView);
newView.setPartnerId(partnerUserId);
getValidUserIdToViewMap().put(partnerUserId, newView);
return true;
}
Aggregations