コード例 #1
0
  private View inflateCallInfoLine(CTCall call) {
    View rowLayout = inflater.inflate(R.layout.call_manager_line, null, false);
    View rowView = (RelativeLayout) rowLayout.findViewById(R.id.CallMngLine);
    rowView.setTag(call);
    if (call.iIsOnHold) rowView.setBackgroundResource(R.drawable.call_mng_hold);

    rowView.setOnLongClickListener(
        new OnLongClickListener() {
          public boolean onLongClick(View view) {
            addRemoveConf(view);
            return true;
          }
        });
    rowView.setOnClickListener(
        new OnClickListener() {
          public void onClick(View view) {
            CTCall call = (CTCall) view.getTag();
            switchCallHold(call, view);
            view.invalidate();
          }
        });
    TextView textView = (TextView) rowLayout.findViewById(R.id.CallMngCallerName);
    textView.setText(call.getNameFromAB());

    textView = (TextView) rowLayout.findViewById(R.id.CallMngCallerNumber);
    textView.setText(call.bufPeer.toString());

    textView = (TextView) rowLayout.findViewById(R.id.CallMngSecState);
    textView.setText(call.bufSecureMsg.toString());

    textView = (TextView) rowLayout.findViewById(R.id.CallMngSas);
    textView.setText(call.bufSAS.toString());

    ImageButton btn = (ImageButton) rowLayout.findViewById(R.id.CallMngEndCall);
    Utilities.setCallerImage(call, (ImageView) rowLayout.findViewById(R.id.CallMngImage));
    btn.setTag(call);
    btn.setOnClickListener(
        new OnClickListener() {
          public void onClick(View view) {
            endCall(true, (CTCall) view.getTag());
          }
        });
    if (call.mustShowAnswerBT()) {
      btn = (ImageButton) rowLayout.findViewById(R.id.CallMngAnswerCall);
      btn.setTag(call);
      btn.setVisibility(View.VISIBLE);
      btn.setEnabled(true);
      btn.setOnClickListener(
          new OnClickListener() {
            public void onClick(View view) {
              answerCall(true, (CTCall) view.getTag());
            }
          });
    }
    return rowView;
  }
コード例 #2
0
  public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);

    String action = getIntent().getAction();

    if (CALL_MGR_STOP.equals(action)) finish();

    // This is a phone call screen, thus perform some specific handling
    // TODO: Proximity handling similar to CallWindow?
    int wflags = WindowManager.LayoutParams.FLAG_SHOW_WHEN_LOCKED;
    wflags |= WindowManager.LayoutParams.FLAG_IGNORE_CHEEK_PRESSES;
    wflags |= WindowManager.LayoutParams.FLAG_DISMISS_KEYGUARD;

    getWindow().addFlags(wflags);

    setContentView(R.layout.activity_call_manager);

    canUseZrtp = Utilities.checkZRTP();

    res = getResources();
    inflater = (LayoutInflater) getSystemService(Context.LAYOUT_INFLATER_SERVICE);

    callMngrContent = (LinearLayout) findViewById(R.id.CallManagerContent);

    float fontSize = res.getDimension(R.dimen.call_manager_header_text_size);

    conferenceTitle = new TextView(this);
    conferenceTitle.setText(getString(R.string.call_mng_conference));
    conferenceTitle.setBackgroundResource(R.drawable.text_custom);
    conferenceTitle.setTextSize(fontSize);

    inOutTitle = new TextView(this);
    inOutTitle.setText(getString(R.string.call_mng_in_out));
    inOutTitle.setBackgroundResource(R.drawable.text_custom);
    inOutTitle.setTextSize(fontSize);

    privateTitle = new TextView(this);
    privateTitle.setText(getString(R.string.call_mng_private));
    privateTitle.setBackgroundResource(R.drawable.text_custom);
    privateTitle.setTextSize(fontSize);

    // Local bind the TiviPhoneService
    doBindService();
    setupCallLists();
  }