aboutsummaryrefslogtreecommitdiffstats
path: root/java/src/com/android/inputmethod/latin/InputAttributes.java
diff options
context:
space:
mode:
authorDavid Faden <dfaden@google.com>2014-08-28 16:56:04 -0700
committerJean Chalard <jchalard@google.com>2014-09-01 03:59:38 +0000
commit95b7bd3ba5bc76dedb964f0fb9a858e072ea4e91 (patch)
tree3412d0a850f71708bc9ebbfaadd4ee6243b41b23 /java/src/com/android/inputmethod/latin/InputAttributes.java
parentdec2c2d9101d367f5d036a2c4aca24f9f9334039 (diff)
downloadlatinime-95b7bd3ba5bc76dedb964f0fb9a858e072ea4e91.tar.gz
latinime-95b7bd3ba5bc76dedb964f0fb9a858e072ea4e91.tar.xz
latinime-95b7bd3ba5bc76dedb964f0fb9a858e072ea4e91.zip
Add a private IME option to suppress the gesture floating preview text.
If the option defined by Constants.NO_FLOATING_GESTURE_PREVIEW is set for a text field via EditorInfo.privateImeOptions, the floating gesture preview will be suppressed regardless of the settings preference. Feature request: bug: 17325039 Change-Id: I1a1df194369e8f2d76abd9d84939a057f55f4a1c
Diffstat (limited to 'java/src/com/android/inputmethod/latin/InputAttributes.java')
-rw-r--r--java/src/com/android/inputmethod/latin/InputAttributes.java11
1 files changed, 11 insertions, 0 deletions
diff --git a/java/src/com/android/inputmethod/latin/InputAttributes.java b/java/src/com/android/inputmethod/latin/InputAttributes.java
index ebe436128..782e18255 100644
--- a/java/src/com/android/inputmethod/latin/InputAttributes.java
+++ b/java/src/com/android/inputmethod/latin/InputAttributes.java
@@ -16,6 +16,7 @@
package com.android.inputmethod.latin;
+import static com.android.inputmethod.latin.Constants.ImeOption.NO_FLOATING_GESTURE_PREVIEW;
import static com.android.inputmethod.latin.Constants.ImeOption.NO_MICROPHONE;
import static com.android.inputmethod.latin.Constants.ImeOption.NO_MICROPHONE_COMPAT;
@@ -42,6 +43,12 @@ public final class InputAttributes {
final public boolean mApplicationSpecifiedCompletionOn;
final public boolean mShouldInsertSpacesAutomatically;
final public boolean mShouldShowVoiceInputKey;
+ /**
+ * Whether the floating gesture preview should be disabled. If true, this should override the
+ * corresponding keyboard settings preference, always suppressing the floating preview text.
+ * {@link com.android.inputmethod.latin.settings.SettingsValues#mGestureFloatingPreviewTextEnabled}
+ */
+ final public boolean mDisableGestureFloatingPreviewText;
final private int mInputType;
final private EditorInfo mEditorInfo;
final private String mPackageNameForPrivateImeOptions;
@@ -76,6 +83,7 @@ public final class InputAttributes {
mApplicationSpecifiedCompletionOn = false;
mShouldInsertSpacesAutomatically = false;
mShouldShowVoiceInputKey = false;
+ mDisableGestureFloatingPreviewText = false;
return;
}
// inputClass == InputType.TYPE_CLASS_TEXT
@@ -107,6 +115,9 @@ public final class InputAttributes {
|| hasNoMicrophoneKeyOption();
mShouldShowVoiceInputKey = !noMicrophone;
+ mDisableGestureFloatingPreviewText = InputAttributes.inPrivateImeOptions(
+ mPackageNameForPrivateImeOptions, NO_FLOATING_GESTURE_PREVIEW, editorInfo);
+
// If it's a browser edit field and auto correct is not ON explicitly, then
// disable auto correction, but keep suggestions on.
// If NO_SUGGESTIONS is set, don't do prediction.