diff options
| author | Menny Even Danan <menny@evendanan.net> | 2020-06-17 13:56:31 +0000 |
|---|---|---|
| committer | Menny Even Danan <menny@evendanan.net> | 2020-06-17 14:18:04 +0000 |
| commit | 57251c8d96e83da7f1b9b9491519eeaa52deab61 (patch) | |
| tree | d10ef21c12d119e19ca9c5d84c27adf354321bac /ime/app | |
| parent | 159722867419a0297192f9d63f7ec0f8f4c1f703 (diff) | |
| download | AnySoftKeyboard-57251c8d96e83da7f1b9b9491519eeaa52deab61.tar.gz AnySoftKeyboard-57251c8d96e83da7f1b9b9491519eeaa52deab61.tar.bz2 | |
Allow suggestions in auto-complete text-view. #1331
Diffstat (limited to 'ime/app')
| -rw-r--r-- | ime/app/src/main/java/com/anysoftkeyboard/ime/AnySoftKeyboardSuggestions.java | 8 | ||||
| -rw-r--r-- | ime/app/src/test/java/com/anysoftkeyboard/AnySoftKeyboardDictionaryEnablingTest.java | 12 |
2 files changed, 8 insertions, 12 deletions
diff --git a/ime/app/src/main/java/com/anysoftkeyboard/ime/AnySoftKeyboardSuggestions.java b/ime/app/src/main/java/com/anysoftkeyboard/ime/AnySoftKeyboardSuggestions.java index 3c5b23370..93bc6d74e 100644 --- a/ime/app/src/main/java/com/anysoftkeyboard/ime/AnySoftKeyboardSuggestions.java +++ b/ime/app/src/main/java/com/anysoftkeyboard/ime/AnySoftKeyboardSuggestions.java @@ -415,12 +415,8 @@ public abstract class AnySoftKeyboardSuggestions extends AnySoftKeyboardKeyboard final int textFlag = attribute.inputType & EditorInfo.TYPE_MASK_FLAGS; if ((textFlag & EditorInfo.TYPE_TEXT_FLAG_NO_SUGGESTIONS) - == EditorInfo.TYPE_TEXT_FLAG_NO_SUGGESTIONS - || (textFlag & EditorInfo.TYPE_TEXT_FLAG_AUTO_COMPLETE) - == EditorInfo.TYPE_TEXT_FLAG_AUTO_COMPLETE) { - Logger.d( - TAG, - "Input requested NO_SUGGESTIONS, or it is AUTO_COMPLETE by itself."); + == EditorInfo.TYPE_TEXT_FLAG_NO_SUGGESTIONS) { + Logger.d(TAG, "Input requested NO_SUGGESTIONS."); mPredictionOn = false; } diff --git a/ime/app/src/test/java/com/anysoftkeyboard/AnySoftKeyboardDictionaryEnablingTest.java b/ime/app/src/test/java/com/anysoftkeyboard/AnySoftKeyboardDictionaryEnablingTest.java index a054ee4c1..0841ffc24 100644 --- a/ime/app/src/test/java/com/anysoftkeyboard/AnySoftKeyboardDictionaryEnablingTest.java +++ b/ime/app/src/test/java/com/anysoftkeyboard/AnySoftKeyboardDictionaryEnablingTest.java @@ -18,7 +18,7 @@ import org.mockito.Mockito; @RunWith(AnySoftKeyboardRobolectricTestRunner.class) public class AnySoftKeyboardDictionaryEnablingTest extends AnySoftKeyboardBaseTest { - private static final String[] DICTIONATY_WORDS = + private static final String[] DICTIONARY_WORDS = new String[] { "high", "hello", "menny", "AnySoftKeyboard", "keyboard", "com/google", "low" }; @@ -27,9 +27,9 @@ public class AnySoftKeyboardDictionaryEnablingTest extends AnySoftKeyboardBaseTe public void setUp() throws Exception { UserDictionary userDictionary = new UserDictionary(getApplicationContext(), "en"); userDictionary.loadDictionary(); - for (int wordIndex = 0; wordIndex < DICTIONATY_WORDS.length; wordIndex++) { + for (int wordIndex = 0; wordIndex < DICTIONARY_WORDS.length; wordIndex++) { userDictionary.addWord( - DICTIONATY_WORDS[wordIndex], DICTIONATY_WORDS.length - wordIndex); + DICTIONARY_WORDS[wordIndex], DICTIONARY_WORDS.length - wordIndex); } userDictionary.close(); } @@ -159,15 +159,15 @@ public class AnySoftKeyboardDictionaryEnablingTest extends AnySoftKeyboardBaseTe } @Test - public void testDictionariesNotCreatedForAutoComplete() { + public void testDictionariesCreatedForAutoComplete() { final EditorInfo editorInfo = TestableAnySoftKeyboard.createEditorInfoTextWithSuggestions(); editorInfo.inputType += EditorInfo.TYPE_TEXT_FLAG_AUTO_COMPLETE; simulateFinishInputFlow(); simulateOnStartInputFlow(false, editorInfo); mAnySoftKeyboardUnderTest.simulateKeyPress('h'); - Assert.assertFalse(mAnySoftKeyboardUnderTest.isPredictionOn()); - Assert.assertFalse(mAnySoftKeyboardUnderTest.isAutoCorrect()); + Assert.assertTrue(mAnySoftKeyboardUnderTest.isPredictionOn()); + Assert.assertTrue(mAnySoftKeyboardUnderTest.isAutoCorrect()); } @Test |
