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);
}
}
}
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;
}
Aggregations