Fix the delay entry handling.
This commit is contained in:
parent
dc5c1c070c
commit
cfac7dcc81
@ -8,8 +8,11 @@
|
|||||||
android:id="@+id/motor_config_delay_diag_edit"
|
android:id="@+id/motor_config_delay_diag_edit"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
|
android:singleLine="true"
|
||||||
android:ems="10"
|
android:ems="10"
|
||||||
android:inputType="number" >
|
android:imeOptions="actionDone"
|
||||||
|
android:inputType="phone"
|
||||||
|
android:digits="1234567890" >
|
||||||
|
|
||||||
<requestFocus />
|
<requestFocus />
|
||||||
</EditText>
|
</EditText>
|
||||||
|
@ -11,6 +11,7 @@ import android.view.KeyEvent;
|
|||||||
import android.view.LayoutInflater;
|
import android.view.LayoutInflater;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
import android.view.ViewGroup;
|
import android.view.ViewGroup;
|
||||||
|
import android.view.inputmethod.EditorInfo;
|
||||||
import android.widget.ArrayAdapter;
|
import android.widget.ArrayAdapter;
|
||||||
import android.widget.EditText;
|
import android.widget.EditText;
|
||||||
import android.widget.ListView;
|
import android.widget.ListView;
|
||||||
@ -50,7 +51,8 @@ implements View.OnClickListener, TextView.OnEditorActionListener {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean onEditorAction(TextView v, int actionId, KeyEvent event) {
|
public boolean onEditorAction(TextView v, int actionId, KeyEvent event) {
|
||||||
if ( event.getAction() == KeyEvent.ACTION_UP && event.getKeyCode() == KeyEvent.KEYCODE_ENTER ) {
|
|
||||||
|
if ( actionId == EditorInfo.IME_ACTION_DONE ) {
|
||||||
String s = v.getText().toString();
|
String s = v.getText().toString();
|
||||||
if ( s != null ) { // note requires ems=10
|
if ( s != null ) { // note requires ems=10
|
||||||
long value = Long.parseLong(s);
|
long value = Long.parseLong(s);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user