diff options
| author | Tadashi G. Takaoka <takaoka@google.com> | 2011-05-28 23:40:19 +0900 |
|---|---|---|
| committer | Tadashi G. Takaoka <takaoka@google.com> | 2011-05-31 16:27:28 +0900 |
| commit | d555e5dccc41174893475d484d0f202d1956c430 (patch) | |
| tree | caa81947adf73630b59476b4fc31ddae8d388a6f /core/java/android/webkit/WebTextView.java | |
| parent | 39a8dc4aaf6b8ff63b3168a8f7e3b8153d3891d8 (diff) | |
Fix input type judgment of WebTextView
Bug: 4490948
Cherry-pick: I232b8f13
Change-Id: I09a7e829edd7ca8d54fa109dc14b4a3946de0f1b
Diffstat (limited to 'core/java/android/webkit/WebTextView.java')
| -rw-r--r-- | core/java/android/webkit/WebTextView.java | 25 |
1 files changed, 15 insertions, 10 deletions
diff --git a/core/java/android/webkit/WebTextView.java b/core/java/android/webkit/WebTextView.java index a480b84f8038..d54230c6cf6f 100644 --- a/core/java/android/webkit/WebTextView.java +++ b/core/java/android/webkit/WebTextView.java @@ -34,6 +34,7 @@ import android.text.BoringLayout.Metrics; import android.text.DynamicLayout; import android.text.Editable; import android.text.InputFilter; +import android.text.InputType; import android.text.Layout; import android.text.Selection; import android.text.Spannable; @@ -853,7 +854,7 @@ import junit.framework.Assert; public void setAdapterCustom(AutoCompleteAdapter adapter) { if (adapter != null) { setInputType(getInputType() - | EditorInfo.TYPE_TEXT_FLAG_AUTO_COMPLETE); + | InputType.TYPE_TEXT_FLAG_AUTO_COMPLETE); adapter.setTextView(this); if (mAutoFillable) { setOnItemClickListener(this); @@ -934,7 +935,7 @@ import junit.framework.Assert; */ /* package */ void setInPassword(boolean inPassword) { if (inPassword) { - setInputType(EditorInfo.TYPE_CLASS_TEXT | EditorInfo. + setInputType(InputType.TYPE_CLASS_TEXT | EditorInfo. TYPE_TEXT_VARIATION_WEB_PASSWORD); createBackground(); } @@ -1146,8 +1147,8 @@ import junit.framework.Assert; boolean single = true; boolean inPassword = false; int maxLength = -1; - int inputType = EditorInfo.TYPE_CLASS_TEXT - | EditorInfo.TYPE_TEXT_VARIATION_WEB_EDIT_TEXT; + int inputType = InputType.TYPE_CLASS_TEXT + | InputType.TYPE_TEXT_VARIATION_WEB_EDIT_TEXT; int imeOptions = EditorInfo.IME_FLAG_NO_EXTRACT_UI | EditorInfo.IME_FLAG_NO_FULLSCREEN; if (TEXT_AREA != type @@ -1160,9 +1161,9 @@ import junit.framework.Assert; break; case TEXT_AREA: single = false; - inputType |= EditorInfo.TYPE_TEXT_FLAG_MULTI_LINE - | EditorInfo.TYPE_TEXT_FLAG_CAP_SENTENCES - | EditorInfo.TYPE_TEXT_FLAG_AUTO_CORRECT; + inputType |= InputType.TYPE_TEXT_FLAG_MULTI_LINE + | InputType.TYPE_TEXT_FLAG_CAP_SENTENCES + | InputType.TYPE_TEXT_FLAG_AUTO_CORRECT; imeOptions |= EditorInfo.IME_ACTION_NONE; break; case PASSWORD: @@ -1173,17 +1174,21 @@ import junit.framework.Assert; imeOptions |= EditorInfo.IME_ACTION_SEARCH; break; case EMAIL: - inputType |= EditorInfo.TYPE_TEXT_VARIATION_WEB_EMAIL_ADDRESS; + // inputType needs to be overwritten because of the different text variation. + inputType = InputType.TYPE_CLASS_TEXT + | InputType.TYPE_TEXT_VARIATION_WEB_EMAIL_ADDRESS; imeOptions |= EditorInfo.IME_ACTION_GO; break; case NUMBER: - inputType |= EditorInfo.TYPE_CLASS_NUMBER; + // inputType needs to be overwritten because of the different class. + inputType = InputType.TYPE_CLASS_NUMBER | InputType.TYPE_NUMBER_VARIATION_NORMAL; // Number and telephone do not have both a Tab key and an // action, so set the action to NEXT imeOptions |= EditorInfo.IME_ACTION_NEXT; break; case TELEPHONE: - inputType |= EditorInfo.TYPE_CLASS_PHONE; + // inputType needs to be overwritten because of the different class. + inputType = InputType.TYPE_CLASS_PHONE; imeOptions |= EditorInfo.IME_ACTION_NEXT; break; case URL: |
