Search in sources :

Example 1 with DigitsKeyListener

use of android.text.method.DigitsKeyListener in project standup-timer by jwood.

the class ConfigureStandupTimer method createMeetingLengthTextBox.

private View createMeetingLengthTextBox() {
    meetingLengthEditText = new EditText(this);
    meetingLengthEditText.setGravity(Gravity.CENTER);
    meetingLengthEditText.setKeyListener(new DigitsKeyListener());
    meetingLengthEditText.setRawInputType(InputType.TYPE_CLASS_PHONE);
    meetingLengthEditText.setLayoutParams(new LayoutParams(dipsToPixels(60), LayoutParams.WRAP_CONTENT));
    meetingLengthEditText.setText(Integer.toString(meetingLength));
    meetingLengthEditText.setLines(1);
    meetingLengthSpinner = null;
    return meetingLengthEditText;
}
Also used : EditText(android.widget.EditText) LayoutParams(android.view.ViewGroup.LayoutParams) DigitsKeyListener(android.text.method.DigitsKeyListener)

Example 2 with DigitsKeyListener

use of android.text.method.DigitsKeyListener in project UltimateAndroid by cymcsg.

the class ConfigureStandupTimer method createMeetingLengthTextBox.

private View createMeetingLengthTextBox() {
    meetingLengthEditText = new EditText(this);
    meetingLengthEditText.setGravity(Gravity.CENTER);
    meetingLengthEditText.setKeyListener(new DigitsKeyListener());
    meetingLengthEditText.setRawInputType(InputType.TYPE_CLASS_PHONE);
    meetingLengthEditText.setLayoutParams(new LayoutParams(dipsToPixels(60), LayoutParams.WRAP_CONTENT));
    meetingLengthEditText.setText(Integer.toString(meetingLength));
    meetingLengthEditText.setLines(1);
    meetingLengthSpinner = null;
    return meetingLengthEditText;
}
Also used : EditText(android.widget.EditText) LayoutParams(android.view.ViewGroup.LayoutParams) DigitsKeyListener(android.text.method.DigitsKeyListener)

Aggregations

DigitsKeyListener (android.text.method.DigitsKeyListener)2 LayoutParams (android.view.ViewGroup.LayoutParams)2 EditText (android.widget.EditText)2