use of com.fanap.podcall.view.CallPartnerView in project pod-chat-android-sdk by FanapSoft.
the class CallPresenter method onCallParticipantJoined.
@Override
public void onCallParticipantJoined(ChatResponse<JoinCallParticipantResult> response) {
for (CallParticipantVO callParticipant : response.getResult().getJoinedParticipants()) {
try {
activity.runOnUiThread(() -> {
if (cpvManager != null) {
cpvManager.showPartnerName(callParticipant.getUserId(), callParticipant.getParticipantVO().getName());
return;
}
CallPartnerView pw = findParticipantView(callParticipant.getUserId());
pw.setDisplayName(true);
pw.setPartnerName(callParticipant.getParticipantVO().getName());
});
} catch (Exception exc) {
exc.printStackTrace();
}
view.showMessage(callParticipant.getParticipantVO().getName() + " وارد تماس شد!");
}
}
use of com.fanap.podcall.view.CallPartnerView in project pod-chat-android-sdk by FanapSoft.
the class CallActivity method init.
private void init() {
viewSwitcherRecentCalls = findViewById(R.id.viewSwitcherRecentCalls);
presenter = new CallPresenter(this, this, this);
recyclerViewHistory = findViewById(R.id.recyclerViewHistories);
buttonAddCallParticipant = findViewById(R.id.buttonAddPartner);
tvStatus = findViewById(R.id.tvStatus);
tvCallerName = findViewById(R.id.tvCallerName);
tvCalleeName = findViewById(R.id.tvCalleeName);
tvHistory = findViewById(R.id.tvHistory);
tvVersion = findViewById(R.id.tvVersion);
callRequestView = findViewById(R.id.viewCallRequest);
inCallView = findViewById(R.id.viewCall);
viewCallProfileBorder = findViewById(R.id.viewCallerProfileBorder);
buttonAcceptCall = findViewById(R.id.buttonAccept);
buttonAcceptWithAudio = findViewById(R.id.buttonAcceptWithAudio);
buttonRejectCall = findViewById(R.id.buttonReject);
buttonRejectWithMessage = findViewById(R.id.buttonRejectWithMessage);
buttonEndCall = findViewById(R.id.buttonEndCall);
buttonStartCallById = findViewById(R.id.btnSandboxCall);
buttonStartScreenShare = findViewById(R.id.buttonScreenShare);
buttonStartCallRecord = findViewById(R.id.buttonStartRecord);
buttonMute = findViewById(R.id.buttonMute);
buttonSpeaker = findViewById(R.id.buttonSpeakerOn);
imgBtnSwitchCamera = findViewById(R.id.imgBtnSwitchCamera);
imgBtnTurnOnCam = findViewById(R.id.imgBtnTurnOnCam);
imgBtnTurnOffCam = findViewById(R.id.imgBtnTurnOffCam);
imgBtnTurnOffIncomingVideos = findViewById(R.id.imgBtnTurnOffIncomingVideos);
imgBtnTurnOnIncomingVideos = findViewById(R.id.imgBtnTurnOnIncomingVideos);
etSandboxThreadId = findViewById(R.id.etSandBoxPartnerId);
frameLayout = findViewById(R.id.frame_call);
fabContacts = findViewById(R.id.fabShowContactsList);
fabSetting = findViewById(R.id.fabShowSetting);
Logger.addLogAdapter(new AndroidLogAdapter());
imgViewCallerProfile = findViewById(R.id.imgViewCallerProfile);
imgViewCallerProfileInCall = findViewById(R.id.imgViewCallerProfileInCall);
localCallPartner = findViewById(R.id.localPartnerCameraView);
remoteCallPartner1 = findViewById(R.id.remotePartnerView1);
remoteCallPartner2 = findViewById(R.id.remotePartnerView2);
remoteCallPartner3 = findViewById(R.id.remotePartnerView3);
remoteCallPartner4 = findViewById(R.id.remotePartnerView4);
constraintHolder = findViewById(R.id.constraintHolder);
List<CallPartnerView> views = new ArrayList<>();
views.add(remoteCallPartner1);
if (!CALL_PARTNER_VIEW_AUTO_GENERATE_TEST) {
views.add(remoteCallPartner2);
views.add(remoteCallPartner3);
views.add(remoteCallPartner4);
}
presenter.setupVideoCallParam(localCallPartner, views);
vibrator = (Vibrator) getSystemService(Context.VIBRATOR_SERVICE);
CallInfo callInfo = getIntent().getParcelableExtra(ChatConstant.POD_CALL_INFO);
Log.e(TAG, "Call info: " + callInfo);
if (callInfo != null) {
presenter.setCallInfo(callInfo);
showInCallView();
}
tvVersion.setText("v" + BuildConfig.VERSION_NAME);
}
use of com.fanap.podcall.view.CallPartnerView in project pod-chat-android-sdk by FanapSoft.
the class CallPresenter method setNameOnView.
private void setNameOnView(List<CallParticipantVO> callParticipantVOArrayList) {
try {
activity.runOnUiThread(() -> {
for (CallParticipantVO cp : callParticipantVOArrayList) {
if (cp.hasVideo()) {
if (cpvManager != null) {
cpvManager.showPartnerName(cp.getUserId(), cp.getParticipantVO().getContactName());
} else {
CallPartnerView pw = findParticipantView(cp.getUserId());
pw.setPartnerName(cp.getParticipantVO().getContactName());
pw.setDisplayName(true);
}
}
}
});
} catch (Exception ex) {
ex.printStackTrace();
}
}
use of com.fanap.podcall.view.CallPartnerView in project pod-chat-android-sdk by FanapSoft.
the class CallPresenter method onCallParticipantUnMuted.
@Override
public void onCallParticipantUnMuted(ChatResponse<MuteUnMuteCallParticipantResult> response) {
for (CallParticipantVO participant : response.getResult().getCallParticipants()) {
Long userId = participant.getUserId();
if (cpvManager != null) {
activity.runOnUiThread(() -> cpvManager.hideMuteIcon(userId));
} else {
CallPartnerView partnerView = null;
if (userId != null) {
partnerView = findParticipantView(userId);
}
String name = Util.isNotNullOrEmpty(participant.getParticipantVO().getContactName()) ? participant.getParticipantVO().getContactName() : participant.getParticipantVO().getName();
view.showMessage(name + " میکروفنش رو باز کرد 😍");
view.callParticipantUnMuted(participant, partnerView);
}
}
}
use of com.fanap.podcall.view.CallPartnerView in project pod-chat-android-sdk by FanapSoft.
the class CallPresenter method onCallParticipantMuted.
@Override
public void onCallParticipantMuted(ChatResponse<MuteUnMuteCallParticipantResult> response) {
for (CallParticipantVO participant : response.getResult().getCallParticipants()) {
Long userId = participant.getUserId();
if (cpvManager != null) {
activity.runOnUiThread(() -> cpvManager.showMuteIcon(userId));
} else {
CallPartnerView partnerView = null;
if (userId != null) {
partnerView = findParticipantView(userId);
}
String name = Util.isNotNullOrEmpty(participant.getParticipantVO().getContactName()) ? participant.getParticipantVO().getContactName() : participant.getParticipantVO().getName();
view.showMessage(name + " میکروفنش رو بست 🤐");
view.callParticipantMuted(participant, partnerView);
}
}
}
Aggregations