diff options
-rw-r--r-- | core/java/android/inputmethodservice/InputMethodService.java | 9 | ||||
-rw-r--r-- | core/java/android/view/inputmethod/EditorInfo.java | 10 | ||||
-rw-r--r-- | core/java/android/webkit/WebTextView.java | 13 |
3 files changed, 25 insertions, 7 deletions
diff --git a/core/java/android/inputmethodservice/InputMethodService.java b/core/java/android/inputmethodservice/InputMethodService.java index 5499bba..6978974 100644 --- a/core/java/android/inputmethodservice/InputMethodService.java +++ b/core/java/android/inputmethodservice/InputMethodService.java @@ -841,7 +841,14 @@ public class InputMethodService extends AbstractInputMethodService { */ public boolean onEvaluateFullscreenMode() { Configuration config = getResources().getConfiguration(); - return config.orientation == Configuration.ORIENTATION_LANDSCAPE; + if (config.orientation != Configuration.ORIENTATION_LANDSCAPE) { + return false; + } + if (mInputEditorInfo != null + && (mInputEditorInfo.imeOptions & EditorInfo.IME_FLAG_NO_FULLSCREEN) != 0) { + return false; + } + return true; } /** diff --git a/core/java/android/view/inputmethod/EditorInfo.java b/core/java/android/view/inputmethod/EditorInfo.java index c718bac..3da18d6 100644 --- a/core/java/android/view/inputmethod/EditorInfo.java +++ b/core/java/android/view/inputmethod/EditorInfo.java @@ -111,7 +111,15 @@ public class EditorInfo implements InputType, Parcelable { * flag for you on multi-line text views. */ public static final int IME_FLAG_NO_ENTER_ACTION = 0x40000000; - + + /** + * Flag of {@link #imeOptions}: used to request that the IME never go + * into fullscreen mode. Applications need to be aware that the flag is not + * a guarantee, and not all IMEs will respect it. + * @hide + */ + public static final int IME_FLAG_NO_FULLSCREEN = 0x80000000; + /** * Generic unspecified type for {@link #imeOptions}. */ diff --git a/core/java/android/webkit/WebTextView.java b/core/java/android/webkit/WebTextView.java index b6891b1..6d0be43 100644 --- a/core/java/android/webkit/WebTextView.java +++ b/core/java/android/webkit/WebTextView.java @@ -807,19 +807,21 @@ import java.util.ArrayList; int maxLength = -1; int inputType = EditorInfo.TYPE_CLASS_TEXT | EditorInfo.TYPE_TEXT_VARIATION_WEB_EDIT_TEXT; + int imeOptions = EditorInfo.IME_FLAG_NO_EXTRACT_UI + | EditorInfo.IME_FLAG_NO_FULLSCREEN; switch (type) { case 1: // TEXT_AREA single = false; inputType |= EditorInfo.TYPE_TEXT_FLAG_MULTI_LINE | EditorInfo.TYPE_TEXT_FLAG_CAP_SENTENCES | EditorInfo.TYPE_TEXT_FLAG_AUTO_CORRECT; - setImeOptions(EditorInfo.IME_ACTION_NONE); + imeOptions |= EditorInfo.IME_ACTION_NONE; break; case 2: // PASSWORD inPassword = true; break; case 3: // SEARCH - setImeOptions(EditorInfo.IME_ACTION_SEARCH); + imeOptions |= EditorInfo.IME_ACTION_SEARCH; break; case 4: // EMAIL // TYPE_TEXT_VARIATION_WEB_EDIT_TEXT prevents EMAIL_ADDRESS @@ -858,14 +860,14 @@ import java.util.ArrayList; switch (action) { // Keep in sync with CachedRoot::ImeAction case 0: // NEXT - setImeOptions(EditorInfo.IME_ACTION_NEXT); + imeOptions |= EditorInfo.IME_ACTION_NEXT; break; case 1: // GO - setImeOptions(EditorInfo.IME_ACTION_GO); + imeOptions |= EditorInfo.IME_ACTION_GO; break; case -1: // FAILURE case 2: // DONE - setImeOptions(EditorInfo.IME_ACTION_DONE); + imeOptions |= EditorInfo.IME_ACTION_DONE; break; } } @@ -874,6 +876,7 @@ import java.util.ArrayList; setMaxLength(maxLength); setHorizontallyScrolling(single); setInputType(inputType); + setImeOptions(imeOptions); setInPassword(inPassword); AutoCompleteAdapter adapter = null; setAdapterCustom(adapter); |