use of im.actor.core.viewmodel.CallVM in project actor-platform by actorapp.
the class JsBindingModule method getCall.
public JsBindedValue<JsCall> getCall(String id) {
if (!calls.containsKey(id)) {
final CallVM callModel = messenger.getCall(Long.parseLong(id));
final JsBindedValue<JsCall> jsCall = new JsBindedValue<>(JsCall.create(messenger, callModel));
callModel.getState().subscribe(new ValueChangedListener<CallState>() {
@Override
public void onChanged(CallState val, Value<CallState> valueModel) {
jsCall.changeValue(JsCall.create(messenger, callModel));
}
});
callModel.getMembers().subscribe(new ValueChangedListener<ArrayList<CallMember>>() {
@Override
public void onChanged(ArrayList<CallMember> val, Value<ArrayList<CallMember>> valueModel) {
jsCall.changeValue(JsCall.create(messenger, callModel));
}
});
callModel.getOwnVideoTracks().subscribe(new ValueChangedListener<ArrayListMediaTrack>() {
@Override
public void onChanged(ArrayListMediaTrack val, Value<ArrayListMediaTrack> valueModel) {
jsCall.changeValue(JsCall.create(messenger, callModel));
}
});
callModel.getTheirVideoTracks().subscribe(new ValueChangedListener<ArrayListMediaTrack>() {
@Override
public void onChanged(ArrayListMediaTrack val, Value<ArrayListMediaTrack> valueModel) {
jsCall.changeValue(JsCall.create(messenger, callModel));
}
});
calls.put(id, jsCall);
}
return calls.get(id);
}
use of im.actor.core.viewmodel.CallVM in project actor-platform by actorapp.
the class CallActivity method onCreateOptionsMenu.
@Override
public boolean onCreateOptionsMenu(Menu menu) {
// Inflating menu
getMenuInflater().inflate(R.menu.call_menu, menu);
CallVM call = messenger().getCall(callId);
if (call != null && call.getPeer().getPeerType() != PeerType.GROUP) {
menu.findItem(R.id.members).setVisible(false);
}
return super.onCreateOptionsMenu(menu);
}
Aggregations