summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Leon Scroggins <scroggo@google.com> 2010-01-13 06:15:38 -0800
committer Android Git Automerger <android-git-automerger@android.com> 2010-01-13 06:15:38 -0800
commita77f93f76a40128ecc3d017ead6d1105f96b282a (patch)
tree0e950bc3d2a6baa9adf6946de384692cda67d554
parent85fbfee4c90ccc06a0671e3e2969dd95edc6d2da (diff)
parentace8addce47efc03be5038eef48d7fb066b14aae (diff)
am ace8addc: am 2edd6826: Create a new ImeOption that disables fullscreen in landscape, and use it.
Merge commit 'ace8addce47efc03be5038eef48d7fb066b14aae' * commit 'ace8addce47efc03be5038eef48d7fb066b14aae': Create a new ImeOption that disables fullscreen in landscape, and use it.
-rw-r--r--core/java/android/inputmethodservice/InputMethodService.java9
-rw-r--r--core/java/android/view/inputmethod/EditorInfo.java10
-rw-r--r--core/java/android/webkit/WebTextView.java13
3 files changed, 25 insertions, 7 deletions
diff --git a/core/java/android/inputmethodservice/InputMethodService.java b/core/java/android/inputmethodservice/InputMethodService.java
index b31593277063..5d5bd9ccdd91 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 c718bac29776..3da18d609ac6 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 b6891b1d3b96..6d0be4365efa 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);