Loading java/src/com/android/inputmethod/latin/Constants.java +7 −0 Original line number Diff line number Diff line Loading @@ -57,6 +57,13 @@ public final class Constants { @SuppressWarnings("dep-ann") public static final String FORCE_ASCII = "forceAscii"; /** * The private IME option used to suppress the floating gesture preview for a given text * field. This overrides the corresponding keyboard settings preference. * {@link com.android.inputmethod.latin.settings.SettingsValues#mGestureFloatingPreviewTextEnabled} */ public static final String NO_FLOATING_GESTURE_PREVIEW = "noGestureFloatingPreview"; private ImeOption() { // This utility class is not publicly instantiable. } Loading java/src/com/android/inputmethod/latin/InputAttributes.java +11 −0 Original line number Diff line number Diff line Loading @@ -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; Loading @@ -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; Loading Loading @@ -76,6 +83,7 @@ public final class InputAttributes { mApplicationSpecifiedCompletionOn = false; mShouldInsertSpacesAutomatically = false; mShouldShowVoiceInputKey = false; mDisableGestureFloatingPreviewText = false; return; } // inputClass == InputType.TYPE_CLASS_TEXT Loading Loading @@ -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. Loading java/src/com/android/inputmethod/latin/settings/SettingsValues.java +2 −2 Original line number Diff line number Diff line Loading @@ -162,8 +162,8 @@ public class SettingsValues { autoCorrectionThresholdRawValue); mGestureInputEnabled = Settings.readGestureInputEnabled(prefs, res); mGestureTrailEnabled = prefs.getBoolean(Settings.PREF_GESTURE_PREVIEW_TRAIL, true); mGestureFloatingPreviewTextEnabled = prefs.getBoolean( Settings.PREF_GESTURE_FLOATING_PREVIEW_TEXT, true); mGestureFloatingPreviewTextEnabled = !mInputAttributes.mDisableGestureFloatingPreviewText && prefs.getBoolean(Settings.PREF_GESTURE_FLOATING_PREVIEW_TEXT, true); mPhraseGestureEnabled = Settings.readPhraseGestureEnabled(prefs, res); mAutoCorrectionEnabledPerUserSettings = mAutoCorrectEnabled && !mInputAttributes.mInputTypeNoAutoCorrect; Loading Loading
java/src/com/android/inputmethod/latin/Constants.java +7 −0 Original line number Diff line number Diff line Loading @@ -57,6 +57,13 @@ public final class Constants { @SuppressWarnings("dep-ann") public static final String FORCE_ASCII = "forceAscii"; /** * The private IME option used to suppress the floating gesture preview for a given text * field. This overrides the corresponding keyboard settings preference. * {@link com.android.inputmethod.latin.settings.SettingsValues#mGestureFloatingPreviewTextEnabled} */ public static final String NO_FLOATING_GESTURE_PREVIEW = "noGestureFloatingPreview"; private ImeOption() { // This utility class is not publicly instantiable. } Loading
java/src/com/android/inputmethod/latin/InputAttributes.java +11 −0 Original line number Diff line number Diff line Loading @@ -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; Loading @@ -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; Loading Loading @@ -76,6 +83,7 @@ public final class InputAttributes { mApplicationSpecifiedCompletionOn = false; mShouldInsertSpacesAutomatically = false; mShouldShowVoiceInputKey = false; mDisableGestureFloatingPreviewText = false; return; } // inputClass == InputType.TYPE_CLASS_TEXT Loading Loading @@ -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. Loading
java/src/com/android/inputmethod/latin/settings/SettingsValues.java +2 −2 Original line number Diff line number Diff line Loading @@ -162,8 +162,8 @@ public class SettingsValues { autoCorrectionThresholdRawValue); mGestureInputEnabled = Settings.readGestureInputEnabled(prefs, res); mGestureTrailEnabled = prefs.getBoolean(Settings.PREF_GESTURE_PREVIEW_TRAIL, true); mGestureFloatingPreviewTextEnabled = prefs.getBoolean( Settings.PREF_GESTURE_FLOATING_PREVIEW_TEXT, true); mGestureFloatingPreviewTextEnabled = !mInputAttributes.mDisableGestureFloatingPreviewText && prefs.getBoolean(Settings.PREF_GESTURE_FLOATING_PREVIEW_TEXT, true); mPhraseGestureEnabled = Settings.readPhraseGestureEnabled(prefs, res); mAutoCorrectionEnabledPerUserSettings = mAutoCorrectEnabled && !mInputAttributes.mInputTypeNoAutoCorrect; Loading