Search in sources :

Example 1 with KeyPadView

use of com.voipgrid.vialer.dialer.KeyPadView in project vialer-android by VoIPGRID.

the class CallTransferFragment method onViewCreated.

@Override
public void onViewCreated(View view, Bundle savedInstanceState) {
    super.onViewCreated(view, savedInstanceState);
    TextView callTransferOnHoldNumberTextView = ((TextView) view.findViewById(R.id.call_transfer_number));
    if (!TextUtils.isEmpty(mOriginalCallerId)) {
        callTransferOnHoldNumberTextView.setText(mOriginalCallerId);
    } else {
        callTransferOnHoldNumberTextView.setText(mOriginalCallerPhoneNumber);
    }
    ViewGroup keyPadViewContainer = (ViewGroup) view.findViewById(R.id.fragment_call_transfer);
    KeyPadView keyPadView = (KeyPadView) keyPadViewContainer.findViewById(R.id.key_pad_view);
    keyPadView.setOnKeyPadClickListener(this);
    mNumberInputView = (NumberInputView) view.findViewById(R.id.number_input_edit_text);
    mNumberInputView.setOnInputChangedListener(new NumberInputView.OnInputChangedListener() {

        @Override
        public void onInputChanged(String number) {
        // This is needed to get the remove button to show up.
        }
    });
    View makeTransferCall = view.findViewById(R.id.button_call);
    makeTransferCall.setOnClickListener(this);
    View hangupButton = view.findViewById(R.id.button_transfer_hangup);
    hangupButton.setOnClickListener(this);
    mCallTransferKeyPadView = view.findViewById(R.id.call_transfer_key_pad);
    mCallTransferButtonsContainer = view.findViewById(R.id.call_transfer_buttons);
    mTransferCallButton = view.findViewById(R.id.button_transfer_call);
    mTransferCallButton.setOnClickListener(this);
    if (mSecondCallConnected) {
        mCallTransferKeyPadView.setVisibility(View.GONE);
        mCallTransferButtonsContainer.setVisibility(View.VISIBLE);
    } else {
        mTransferCallButton.setActivated(false);
        mTransferCallButton.setAlpha(0.5f);
    }
}
Also used : NumberInputView(com.voipgrid.vialer.dialer.NumberInputView) ViewGroup(android.view.ViewGroup) TextView(android.widget.TextView) KeyPadView(com.voipgrid.vialer.dialer.KeyPadView) NumberInputView(com.voipgrid.vialer.dialer.NumberInputView) TextView(android.widget.TextView) View(android.view.View) KeyPadView(com.voipgrid.vialer.dialer.KeyPadView)

Example 2 with KeyPadView

use of com.voipgrid.vialer.dialer.KeyPadView in project vialer-android by VoIPGRID.

the class CallKeyPadFragment method onViewCreated.

@Override
public void onViewCreated(View view, Bundle savedInstanceState) {
    super.onViewCreated(view, savedInstanceState);
    ViewGroup keyPadViewContainer = (ViewGroup) view.findViewById(R.id.fragment_call_key_pad);
    KeyPadView keyPadView = (KeyPadView) keyPadViewContainer.findViewById(R.id.key_pad_view);
    keyPadView.setOnKeyPadClickListener(this);
    mHangupButton = view.findViewById(R.id.button_keypad_call_hangup);
    mHangupButton.setOnClickListener(this);
    mNumberInputView = (NumberInputView) view.findViewById(R.id.number_input_edit_text);
    mNumberInputView.setOnInputChangedListener(new NumberInputView.OnInputChangedListener() {

        @Override
        public void onInputChanged(String number) {
        // This is needed to get the remove button to show up.
        }
    });
    AudioManager audioManager = (AudioManager) getActivity().getSystemService(Context.AUDIO_SERVICE);
    mToneGenerator = new ToneGenerator(AudioManager.STREAM_DTMF, (int) (Math.floor(audioManager.getStreamVolume(AudioManager.STREAM_DTMF) * 5)));
}
Also used : AudioManager(android.media.AudioManager) ToneGenerator(com.voipgrid.vialer.dialer.ToneGenerator) NumberInputView(com.voipgrid.vialer.dialer.NumberInputView) ViewGroup(android.view.ViewGroup) KeyPadView(com.voipgrid.vialer.dialer.KeyPadView)

Aggregations

ViewGroup (android.view.ViewGroup)2 KeyPadView (com.voipgrid.vialer.dialer.KeyPadView)2 NumberInputView (com.voipgrid.vialer.dialer.NumberInputView)2 AudioManager (android.media.AudioManager)1 View (android.view.View)1 TextView (android.widget.TextView)1 ToneGenerator (com.voipgrid.vialer.dialer.ToneGenerator)1