Merge "Number and telephone inputs -- use "Go" instead of "Next"" into jb-mr1-dev
This commit is contained in:
@@ -378,28 +378,26 @@ public final class WebViewClassic implements WebViewProvider, WebViewProvider.Sc
|
|||||||
imeOptions |= EditorInfo.IME_FLAG_NAVIGATE_PREVIOUS;
|
imeOptions |= EditorInfo.IME_FLAG_NAVIGATE_PREVIOUS;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
int action = EditorInfo.IME_ACTION_GO;
|
||||||
switch (type) {
|
switch (type) {
|
||||||
case WebTextView.NORMAL_TEXT_FIELD:
|
case WebTextView.NORMAL_TEXT_FIELD:
|
||||||
imeOptions |= EditorInfo.IME_ACTION_GO;
|
|
||||||
break;
|
break;
|
||||||
case WebTextView.TEXT_AREA:
|
case WebTextView.TEXT_AREA:
|
||||||
inputType |= InputType.TYPE_TEXT_FLAG_MULTI_LINE
|
inputType |= InputType.TYPE_TEXT_FLAG_MULTI_LINE
|
||||||
| InputType.TYPE_TEXT_FLAG_CAP_SENTENCES
|
| InputType.TYPE_TEXT_FLAG_CAP_SENTENCES
|
||||||
| InputType.TYPE_TEXT_FLAG_AUTO_CORRECT;
|
| InputType.TYPE_TEXT_FLAG_AUTO_CORRECT;
|
||||||
imeOptions |= EditorInfo.IME_ACTION_NONE;
|
action = EditorInfo.IME_ACTION_NONE;
|
||||||
break;
|
break;
|
||||||
case WebTextView.PASSWORD:
|
case WebTextView.PASSWORD:
|
||||||
inputType |= EditorInfo.TYPE_TEXT_VARIATION_WEB_PASSWORD;
|
inputType |= EditorInfo.TYPE_TEXT_VARIATION_WEB_PASSWORD;
|
||||||
imeOptions |= EditorInfo.IME_ACTION_GO;
|
|
||||||
break;
|
break;
|
||||||
case WebTextView.SEARCH:
|
case WebTextView.SEARCH:
|
||||||
imeOptions |= EditorInfo.IME_ACTION_SEARCH;
|
action = EditorInfo.IME_ACTION_SEARCH;
|
||||||
break;
|
break;
|
||||||
case WebTextView.EMAIL:
|
case WebTextView.EMAIL:
|
||||||
// inputType needs to be overwritten because of the different text variation.
|
// inputType needs to be overwritten because of the different text variation.
|
||||||
inputType = InputType.TYPE_CLASS_TEXT
|
inputType = InputType.TYPE_CLASS_TEXT
|
||||||
| InputType.TYPE_TEXT_VARIATION_WEB_EMAIL_ADDRESS;
|
| InputType.TYPE_TEXT_VARIATION_WEB_EMAIL_ADDRESS;
|
||||||
imeOptions |= EditorInfo.IME_ACTION_GO;
|
|
||||||
break;
|
break;
|
||||||
case WebTextView.NUMBER:
|
case WebTextView.NUMBER:
|
||||||
// inputType needs to be overwritten because of the different class.
|
// inputType needs to be overwritten because of the different class.
|
||||||
@@ -407,23 +405,20 @@ public final class WebViewClassic implements WebViewProvider, WebViewProvider.Sc
|
|||||||
| InputType.TYPE_NUMBER_FLAG_SIGNED | InputType.TYPE_NUMBER_FLAG_DECIMAL;
|
| InputType.TYPE_NUMBER_FLAG_SIGNED | InputType.TYPE_NUMBER_FLAG_DECIMAL;
|
||||||
// Number and telephone do not have both a Tab key and an
|
// Number and telephone do not have both a Tab key and an
|
||||||
// action, so set the action to NEXT
|
// action, so set the action to NEXT
|
||||||
imeOptions |= EditorInfo.IME_ACTION_NEXT;
|
|
||||||
break;
|
break;
|
||||||
case WebTextView.TELEPHONE:
|
case WebTextView.TELEPHONE:
|
||||||
// inputType needs to be overwritten because of the different class.
|
// inputType needs to be overwritten because of the different class.
|
||||||
inputType = InputType.TYPE_CLASS_PHONE;
|
inputType = InputType.TYPE_CLASS_PHONE;
|
||||||
imeOptions |= EditorInfo.IME_ACTION_NEXT;
|
|
||||||
break;
|
break;
|
||||||
case WebTextView.URL:
|
case WebTextView.URL:
|
||||||
// TYPE_TEXT_VARIATION_URI prevents Tab key from showing, so
|
// TYPE_TEXT_VARIATION_URI prevents Tab key from showing, so
|
||||||
// exclude it for now.
|
// exclude it for now.
|
||||||
imeOptions |= EditorInfo.IME_ACTION_GO;
|
|
||||||
inputType |= InputType.TYPE_TEXT_VARIATION_URI;
|
inputType |= InputType.TYPE_TEXT_VARIATION_URI;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
imeOptions |= EditorInfo.IME_ACTION_GO;
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
imeOptions |= action;
|
||||||
mHint = initData.mLabel;
|
mHint = initData.mLabel;
|
||||||
mInputType = inputType;
|
mInputType = inputType;
|
||||||
mImeOptions = imeOptions;
|
mImeOptions = imeOptions;
|
||||||
|
|||||||
Reference in New Issue
Block a user