コード例 #1
0
  public void addConversationFragmentReceiveCall() {

    QBRTCSession session = getCurrentSession();

    if (getCurrentSession() != null) {
      Integer myId = QBChatService.getInstance().getUser().getId();
      ArrayList<Integer> opponentsWithoutMe = new ArrayList<>(session.getOpponents());
      opponentsWithoutMe.remove(new Integer(myId));
      opponentsWithoutMe.add(session.getCallerID());

      ArrayList<QBUser> opponents =
          DataHolder.getUsersByIDs(
              opponentsWithoutMe.toArray(new Integer[opponentsWithoutMe.size()]));
      SettingsUtil.setSettingsStrategy(opponents, getDefaultSharedPrefs(), this);
      ConversationFragment fragment =
          ConversationFragment.newInstance(
              opponents,
              DataHolder.getUserNameByID(session.getCallerID()),
              session.getConferenceType(),
              session.getUserInfo(),
              StartConversetionReason.INCOME_CALL_FOR_ACCEPTION,
              getCurrentSession().getSessionID());
      // Start conversation fragment
      audioManager.init();
      FragmentExecuotr.addFragment(
          getFragmentManager(), R.id.fragment_container, fragment, CONVERSATION_CALL_FRAGMENT);
    }
  }
コード例 #2
0
 public void addOpponentsFragment() {
   FragmentExecuotr.addFragment(
       getFragmentManager(),
       R.id.fragment_container,
       new OpponentsFragment(),
       OPPONENTS_CALL_FRAGMENT);
 }
コード例 #3
0
  public void removeIncomeCallFragment() {
    FragmentManager fragmentManager = getFragmentManager();
    Fragment fragment = fragmentManager.findFragmentByTag(INCOME_CALL_FRAGMENT);

    if (fragment != null) {
      FragmentExecuotr.removeFragment(fragmentManager, fragment);
    }
  }
コード例 #4
0
  private void addIncomeCallFragment(QBRTCSession session) {
    Log.d(TAG, "QBRTCSession in addIncomeCallFragment is " + session);

    if (session != null) {
      Fragment fragment = new IncomeCallFragment();
      Bundle bundle = new Bundle();
      bundle.putSerializable("sessionDescription", session.getSessionDescription());
      bundle.putIntegerArrayList("opponents", new ArrayList<>(session.getOpponents()));
      bundle.putInt(Consts.CONFERENCE_TYPE, session.getConferenceType().getValue());
      fragment.setArguments(bundle);
      FragmentExecuotr.addFragment(
          getFragmentManager(), R.id.fragment_container, fragment, INCOME_CALL_FRAGMENT);
    } else {
      Log.d(TAG, "SKIP addIncomeCallFragment method");
    }
  }
コード例 #5
0
 public void addConversationFragmentStartCall(
     List<QBUser> opponents,
     QBRTCTypes.QBConferenceType qbConferenceType,
     Map<String, String> userInfo) {
   QBRTCSession newSessionWithOpponents =
       rtcClient.createNewSessionWithOpponents(getOpponentsIds(opponents), qbConferenceType);
   SettingsUtil.setSettingsStrategy(opponents, getDefaultSharedPrefs(), this);
   Log.d("Crash", "addConversationFragmentStartCall. Set session " + newSessionWithOpponents);
   initCurrentSession(newSessionWithOpponents);
   ConversationFragment fragment =
       ConversationFragment.newInstance(
           opponents,
           opponents.get(0).getFullName(),
           qbConferenceType,
           userInfo,
           StartConversetionReason.OUTCOME_CALL_MADE,
           getCurrentSession().getSessionID());
   FragmentExecuotr.addFragment(
       getFragmentManager(), R.id.fragment_container, fragment, CONVERSATION_CALL_FRAGMENT);
   audioManager.init();
   ringtonePlayer.play(true);
 }