Skip to content

Commit 21029db

Browse files
George MountAndroid (Google) Code Review
authored andcommitted
Merge "Number and telephone inputs -- use "Go" instead of "Next"" into jb-mr1-dev
2 parents 194b6e9 + 68c0c12 commit 21029db

File tree

1 file changed

+4
-9
lines changed

1 file changed

+4
-9
lines changed

core/java/android/webkit/WebViewClassic.java

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -378,52 +378,47 @@ public void initEditorInfo(WebViewCore.TextFieldInitData initData) {
378378
imeOptions |= EditorInfo.IME_FLAG_NAVIGATE_PREVIOUS;
379379
}
380380
}
381+
int action = EditorInfo.IME_ACTION_GO;
381382
switch (type) {
382383
case WebTextView.NORMAL_TEXT_FIELD:
383-
imeOptions |= EditorInfo.IME_ACTION_GO;
384384
break;
385385
case WebTextView.TEXT_AREA:
386386
inputType |= InputType.TYPE_TEXT_FLAG_MULTI_LINE
387387
| InputType.TYPE_TEXT_FLAG_CAP_SENTENCES
388388
| InputType.TYPE_TEXT_FLAG_AUTO_CORRECT;
389-
imeOptions |= EditorInfo.IME_ACTION_NONE;
389+
action = EditorInfo.IME_ACTION_NONE;
390390
break;
391391
case WebTextView.PASSWORD:
392392
inputType |= EditorInfo.TYPE_TEXT_VARIATION_WEB_PASSWORD;
393-
imeOptions |= EditorInfo.IME_ACTION_GO;
394393
break;
395394
case WebTextView.SEARCH:
396-
imeOptions |= EditorInfo.IME_ACTION_SEARCH;
395+
action = EditorInfo.IME_ACTION_SEARCH;
397396
break;
398397
case WebTextView.EMAIL:
399398
// inputType needs to be overwritten because of the different text variation.
400399
inputType = InputType.TYPE_CLASS_TEXT
401400
| InputType.TYPE_TEXT_VARIATION_WEB_EMAIL_ADDRESS;
402-
imeOptions |= EditorInfo.IME_ACTION_GO;
403401
break;
404402
case WebTextView.NUMBER:
405403
// inputType needs to be overwritten because of the different class.
406404
inputType = InputType.TYPE_CLASS_NUMBER | InputType.TYPE_NUMBER_VARIATION_NORMAL
407405
| InputType.TYPE_NUMBER_FLAG_SIGNED | InputType.TYPE_NUMBER_FLAG_DECIMAL;
408406
// Number and telephone do not have both a Tab key and an
409407
// action, so set the action to NEXT
410-
imeOptions |= EditorInfo.IME_ACTION_NEXT;
411408
break;
412409
case WebTextView.TELEPHONE:
413410
// inputType needs to be overwritten because of the different class.
414411
inputType = InputType.TYPE_CLASS_PHONE;
415-
imeOptions |= EditorInfo.IME_ACTION_NEXT;
416412
break;
417413
case WebTextView.URL:
418414
// TYPE_TEXT_VARIATION_URI prevents Tab key from showing, so
419415
// exclude it for now.
420-
imeOptions |= EditorInfo.IME_ACTION_GO;
421416
inputType |= InputType.TYPE_TEXT_VARIATION_URI;
422417
break;
423418
default:
424-
imeOptions |= EditorInfo.IME_ACTION_GO;
425419
break;
426420
}
421+
imeOptions |= action;
427422
mHint = initData.mLabel;
428423
mInputType = inputType;
429424
mImeOptions = imeOptions;

0 commit comments

Comments
 (0)