Example usage for android.text InputType TYPE_NUMBER_VARIATION_NORMAL

List of usage examples for android.text InputType TYPE_NUMBER_VARIATION_NORMAL

Introduction

In this page you can find the example usage for android.text InputType TYPE_NUMBER_VARIATION_NORMAL.

Prototype

int TYPE_NUMBER_VARIATION_NORMAL

To view the source code for android.text InputType TYPE_NUMBER_VARIATION_NORMAL.

Click Source Link

Document

Default variation of #TYPE_CLASS_NUMBER : plain normal numeric text.

Usage

From source file:nz.ac.otago.psyanlab.common.designer.program.stage.EditPropPropertiesFragment.java

/**
 * Creates an edit text entry field that allows the user to enter an
 * integer.// www.  j a  va 2 s. c  o  m
 * 
 * @param i
 * @param posOnlyAnnotation
 * @return EditText
 */
private View newIntegerInputView(boolean isSigned, int i) {
    EditText view = new EditText(getActivity());
    if (isSigned) {
        view.setInputType(InputType.TYPE_CLASS_NUMBER | InputType.TYPE_NUMBER_VARIATION_NORMAL
                | InputType.TYPE_NUMBER_FLAG_SIGNED);
    } else {
        view.setInputType(InputType.TYPE_CLASS_NUMBER | InputType.TYPE_NUMBER_VARIATION_NORMAL);
    }
    view.setSingleLine();
    view.setText(String.valueOf(i));
    return view;
}