Search in sources :

Example 1 with CallerInfo

use of net.iGap.module.webrtc.CallerInfo in project iGap-Android by KianIranian-STDG.

the class CallManager method setupCallerInfo.

private void setupCallerInfo(long callPeerId) {
    currentCallerInfo = new CallerInfo();
    DbManager.getInstance().doRealmTask(realm -> {
        RealmRegisteredInfo realmRegisteredInfo = realm.where(RealmRegisteredInfo.class).equalTo("id", callPeerId).findFirst();
        if (realmRegisteredInfo != null) {
            currentCallerInfo.name = realmRegisteredInfo.getDisplayName();
            currentCallerInfo.color = realmRegisteredInfo.getColor();
        }
        currentCallerInfo.userId = callPeerId;
    });
}
Also used : CallerInfo(net.iGap.module.webrtc.CallerInfo) RealmRegisteredInfo(net.iGap.realm.RealmRegisteredInfo)

Example 2 with CallerInfo

use of net.iGap.module.webrtc.CallerInfo in project iGap-Android by KianIranian-STDG.

the class FragmentMediaContainer method didCallChange.

private void didCallChange() {
    needShowCall = CallManager.getInstance().isCallAlive();
    if (needShowCall) {
        CallerInfo callerInfo = CallManager.getInstance().getCurrentCallerInfo();
        if (callerInfo != null) {
            mediaContainer.setVisibility(GONE);
            callContainer.setVisibility(VISIBLE);
            callerName.setText(String.format("%s %s", callerInfo.name, callerInfo.lastName));
            avatarHandler.getAvatar(new ParamWithInitBitmap(callerAvatar, callerInfo.userId).initBitmap(null).showMain());
            // TODO: 5/1/21 These colors must change in future
            final int from = Theme.getInstance().getCallStripColor(getContext());
            final int to = Theme.getInstance().getCallStripColorBlue(getContext());
            animateContainerColor(callContainer, from, to, 2000);
            if (getVisibility() != VISIBLE) {
                setVisibilityWithAnimation(this, needShowCall);
            }
        }
    } else {
        if (!MusicPlayer.isMusicPlyerEnable)
            setVisibilityWithAnimation(this, false);
        else {
            setVisibility(VISIBLE);
            mediaContainer.setVisibility(VISIBLE);
        }
    }
}
Also used : CallerInfo(net.iGap.module.webrtc.CallerInfo) ParamWithInitBitmap(net.iGap.helper.avatar.ParamWithInitBitmap)

Aggregations

CallerInfo (net.iGap.module.webrtc.CallerInfo)2 ParamWithInitBitmap (net.iGap.helper.avatar.ParamWithInitBitmap)1 RealmRegisteredInfo (net.iGap.realm.RealmRegisteredInfo)1