Java Code Examples for android.widget.TextView#setImeOptions()

The following examples show how to use android.widget.TextView#setImeOptions() . These examples are extracted from open source projects. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may want to check out the right sidebar which shows the related API usage.
Example 1
/**
 * Sets the IME options for a spinner based on its ordering.
 *
 * @param spinner      The spinner.
 * @param spinnerCount The total spinner count.
 * @param spinnerIndex The index of the given spinner.
 */
private void setImeOptions(NumberPicker spinner, int spinnerCount, int spinnerIndex) {
    final int imeOptions;
    if (spinnerIndex < spinnerCount - 1) {
        imeOptions = EditorInfo.IME_ACTION_NEXT;
    } else {
        imeOptions = EditorInfo.IME_ACTION_DONE;
    }
    TextView input = (TextView) spinner.findViewById(R.id.numberpicker_input);
    input.setImeOptions(imeOptions);
}
 
Example 2
Source Project: ticdesign   File: DatePicker.java    License: Apache License 2.0 5 votes vote down vote up
/**
 * Sets the IME options for a spinner based on its ordering.
 *
 * @param spinner The spinner.
 * @param spinnerCount The total spinner count.
 * @param spinnerIndex The index of the given spinner.
 */
private void setImeOptions(NumberPicker spinner, int spinnerCount, int spinnerIndex) {
    final int imeOptions;
    if (spinnerIndex < spinnerCount - 1) {
        imeOptions = EditorInfo.IME_ACTION_NEXT;
    } else {
        imeOptions = EditorInfo.IME_ACTION_DONE;
    }
    TextView input = (TextView) spinner.findViewById(R.id.numberpicker_input);
    input.setImeOptions(imeOptions);
}