From ec60d60078b4837b657dc207bdbde1748749199e Mon Sep 17 00:00:00 2001 From: Jean Chalard Date: Tue, 13 Nov 2012 15:10:07 +0900 Subject: Only add spaces automatically when appropriate. Correctly check the variations to determine if we should add automatic spaces (in manual picks and gestures) or not. Bug: 7164981 Change-Id: I19e25af839b4062c217113cd804b1473912f22a5 --- java/src/com/android/inputmethod/latin/InputAttributes.java | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'java/src/com/android/inputmethod/latin/InputAttributes.java') diff --git a/java/src/com/android/inputmethod/latin/InputAttributes.java b/java/src/com/android/inputmethod/latin/InputAttributes.java index 2f7608a03..422fc72d3 100644 --- a/java/src/com/android/inputmethod/latin/InputAttributes.java +++ b/java/src/com/android/inputmethod/latin/InputAttributes.java @@ -29,6 +29,7 @@ public final class InputAttributes { final public boolean mInputTypeNoAutoCorrect; final public boolean mIsSettingsSuggestionStripOn; final public boolean mApplicationSpecifiedCompletionOn; + final public boolean mShouldInsertSpacesAutomatically; final private int mInputType; public InputAttributes(final EditorInfo editorInfo, final boolean isFullscreenMode) { @@ -54,6 +55,7 @@ public final class InputAttributes { mIsSettingsSuggestionStripOn = false; mInputTypeNoAutoCorrect = false; mApplicationSpecifiedCompletionOn = false; + mShouldInsertSpacesAutomatically = false; } else { final int variation = inputType & InputType.TYPE_MASK_VARIATION; final boolean flagNoSuggestions = @@ -65,6 +67,7 @@ public final class InputAttributes { final boolean flagAutoComplete = 0 != (inputType & InputType.TYPE_TEXT_FLAG_AUTO_COMPLETE); + // TODO: Have a helper method in InputTypeUtils // Make sure that passwords are not displayed in {@link SuggestionStripView}. if (InputTypeUtils.isPasswordInputType(inputType) || InputTypeUtils.isVisiblePasswordInputType(inputType) @@ -78,6 +81,8 @@ public final class InputAttributes { mIsSettingsSuggestionStripOn = true; } + mShouldInsertSpacesAutomatically = InputTypeUtils.isAutoSpaceFriendlyType(inputType); + // 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. -- cgit v1.2.3-83-g751a