Search in sources :

Example 1 with DialpadView

use of com.android.phone.common.dialpad.DialpadView in project android_packages_apps_Dialer by MoKee.

the class DialpadFragment method onHiddenChanged.

@Override
public void onHiddenChanged(boolean hidden) {
    super.onHiddenChanged(hidden);
    final DialtactsActivity activity = (DialtactsActivity) getActivity();
    final DialpadView dialpadView = (DialpadView) getView().findViewById(R.id.dialpad_view);
    if (activity == null)
        return;
    if (!hidden && !isDialpadChooserVisible()) {
        if (mAnimate) {
            dialpadView.animateShow();
        }
        mFloatingActionButtonController.setVisible(false);
        mFloatingActionButtonController.scaleIn(mAnimate ? mDialpadSlideInDuration : 0);
        activity.onDialpadShown();
        mDigits.requestFocus();
    }
    if (hidden) {
        if (mAnimate) {
            mFloatingActionButtonController.scaleOut();
        } else {
            mFloatingActionButtonController.setVisible(false);
        }
    }
}
Also used : DialtactsActivity(com.android.dialer.DialtactsActivity) DialpadView(com.android.phone.common.dialpad.DialpadView)

Example 2 with DialpadView

use of com.android.phone.common.dialpad.DialpadView in project android_packages_apps_Dialer by MoKee.

the class DialpadFragment method onCreateView.

@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedState) {
    Trace.beginSection(TAG + " onCreateView");
    Trace.beginSection(TAG + " inflate view");
    final View fragmentView = inflater.inflate(R.layout.dialpad_fragment, container, false);
    Trace.endSection();
    Trace.beginSection(TAG + " buildLayer");
    fragmentView.buildLayer();
    Trace.endSection();
    Trace.beginSection(TAG + " setup views");
    mDialpadView = (DialpadView) fragmentView.findViewById(R.id.dialpad_view);
    mDialpadView.setCanDigitsBeEdited(true);
    mDigits = mDialpadView.getDigits();
    mRecipients = (EditText) fragmentView.findViewById(R.id.recipients);
    mDigitsContainer = fragmentView.findViewById(R.id.digits_container);
    mDialpad = fragmentView.findViewById(R.id.dialpad);
    if (mRecipients != null) {
        mRecipients.setVisibility(View.GONE);
        mRecipients.addTextChangedListener(this);
    }
    mDigits.setKeyListener(UnicodeDialerKeyListener.INSTANCE);
    mDigits.setOnClickListener(this);
    mDigits.setOnKeyListener(this);
    mDigits.setOnLongClickListener(this);
    mDigits.addTextChangedListener(this);
    mDigits.setElegantTextHeight(false);
    PhoneNumberFormatter.setPhoneNumberFormattingTextWatcher(getActivity(), mDigits);
    mLocation = mDialpadView.getLocation();
    // Check for the presence of the keypad
    View oneButton = fragmentView.findViewById(R.id.one);
    if (oneButton != null) {
        configureKeypadListeners(fragmentView);
    }
    mDelete = mDialpadView.getDeleteButton();
    if (mDelete != null) {
        mDelete.setOnClickListener(this);
        mDelete.setOnLongClickListener(this);
    }
    mSpacer = fragmentView.findViewById(R.id.spacer);
    mSpacer.setOnTouchListener(new View.OnTouchListener() {

        @Override
        public boolean onTouch(View v, MotionEvent event) {
            if (isDigitsEmpty()) {
                if (getActivity() != null) {
                    return ((HostInterface) getActivity()).onDialpadSpacerTouchWithEmptyQuery();
                }
                return true;
            }
            return false;
        }
    });
    mDigits.setCursorVisible(false);
    // Set up the "dialpad chooser" UI; see showDialpadChooser().
    mDialpadChooser = (ListView) fragmentView.findViewById(R.id.dialpadChooser);
    mDialpadChooser.setOnItemClickListener(this);
    final View floatingActionButtonContainer = fragmentView.findViewById(R.id.dialpad_floating_action_button_container);
    final ImageButton floatingActionButton = (ImageButton) fragmentView.findViewById(R.id.dialpad_floating_action_button);
    floatingActionButton.setOnClickListener(this);
    mFloatingActionButtonController = new FloatingActionButtonController(getActivity(), floatingActionButtonContainer, floatingActionButton);
    mOperator = (TextView) fragmentView.findViewById(R.id.dialpad_floating_operator);
    Trace.endSection();
    Trace.endSection();
    return fragmentView;
}
Also used : FloatingActionButtonController(com.android.contacts.common.widget.FloatingActionButtonController) ImageButton(android.widget.ImageButton) ImageView(android.widget.ImageView) View(android.view.View) AdapterView(android.widget.AdapterView) TextView(android.widget.TextView) ListView(android.widget.ListView) DialpadView(com.android.phone.common.dialpad.DialpadView) MotionEvent(android.view.MotionEvent)

Aggregations

DialpadView (com.android.phone.common.dialpad.DialpadView)2 MotionEvent (android.view.MotionEvent)1 View (android.view.View)1 AdapterView (android.widget.AdapterView)1 ImageButton (android.widget.ImageButton)1 ImageView (android.widget.ImageView)1 ListView (android.widget.ListView)1 TextView (android.widget.TextView)1 FloatingActionButtonController (com.android.contacts.common.widget.FloatingActionButtonController)1 DialtactsActivity (com.android.dialer.DialtactsActivity)1