Loading java/src/com/android/inputmethod/latin/LatinIME.java +18 −18 Original line number Diff line number Diff line Loading @@ -206,7 +206,7 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen final KeyboardSwitcher switcher = latinIme.mKeyboardSwitcher; switch (msg.what) { case MSG_UPDATE_SUGGESTION_STRIP: latinIme.updateSuggestionsOrPredictions(); latinIme.updateSuggestionStrip(); break; case MSG_UPDATE_SHIFT_STATE: switcher.updateShiftState(); Loading Loading @@ -862,7 +862,7 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen if (!mCurrentSettings.isApplicationSpecifiedCompletionsOn()) return; mApplicationSpecifiedCompletions = applicationSpecifiedCompletions; if (applicationSpecifiedCompletions == null) { clearSuggestions(); clearSuggestionStrip(); return; } Loading @@ -878,7 +878,7 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen false /* isPrediction */); // When in fullscreen mode, show completions generated by the application final boolean isAutoCorrection = false; setSuggestions(suggestedWords, isAutoCorrection); setSuggestionStrip(suggestedWords, isAutoCorrection); setAutoCorrectionIndicator(isAutoCorrection); // TODO: is this the right thing to do? What should we auto-correct to in // this case? This says to keep whatever the user typed. Loading Loading @@ -988,7 +988,7 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen // the composing word, reset the last composed word, tell the inputconnection about it. private void resetEntireInputState() { resetComposingState(true /* alsoResetLastComposedWord */); clearSuggestions(); clearSuggestionStrip(); mConnection.finishComposingText(); } Loading @@ -1011,7 +1011,7 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen LastComposedWord.COMMIT_TYPE_USER_TYPED_WORD, typedWord.toString(), separatorCode, prevWord); } updateSuggestionsOrPredictions(); updateSuggestionStrip(); } // Called from the KeyboardSwitcher which needs to know auto caps state to display Loading Loading @@ -1332,13 +1332,13 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen @Override public void onUpdateBatchInput(InputPointers batchPointers) { mWordComposer.setBatchInputPointers(batchPointers); updateSuggestionsOrPredictions(); updateSuggestionStrip(); } @Override public void onEndBatchInput(InputPointers batchPointers) { mWordComposer.setBatchInputPointers(batchPointers); final SuggestedWords suggestedWords = updateSuggestionsOrPredictions(); final SuggestedWords suggestedWords = updateSuggestionStrip(); if (suggestedWords == null || suggestedWords.size() == 0) { return; } Loading Loading @@ -1668,12 +1668,12 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen return mCurrentSettings.isSuggestionsRequested(mDisplayOrientation); } private void clearSuggestions() { setSuggestions(SuggestedWords.EMPTY, false); private void clearSuggestionStrip() { setSuggestionStrip(SuggestedWords.EMPTY, false); setAutoCorrectionIndicator(false); } private void setSuggestions(final SuggestedWords words, final boolean isAutoCorrection) { private void setSuggestionStrip(final SuggestedWords words, final boolean isAutoCorrection) { if (mSuggestionStripView != null) { mSuggestionStripView.setSuggestions(words); mKeyboardSwitcher.onAutoCorrectionStateChanged(isAutoCorrection); Loading @@ -1692,7 +1692,7 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen } // TODO: rename this method to updateSuggestionStrip or simply updateSuggestions private SuggestedWords updateSuggestionsOrPredictions() { private SuggestedWords updateSuggestionStrip() { mHandler.cancelUpdateSuggestionStrip(); // Check if we have a suggestion engine attached. Loading Loading @@ -1723,7 +1723,7 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen mCurrentSettings.mCorrectionEnabled); suggestedWords = maybeRetrieveOlderSuggestions(typedWord, suggestedWords); showSuggestions(suggestedWords, typedWord); showSuggestionStrip(suggestedWords, typedWord); return suggestedWords; } Loading Loading @@ -1757,10 +1757,10 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen } } private void showSuggestions(final SuggestedWords suggestedWords, private void showSuggestionStrip(final SuggestedWords suggestedWords, final CharSequence typedWord) { if (null == suggestedWords || suggestedWords.size() <= 0) { clearSuggestions(); clearSuggestionStrip(); return; } final CharSequence autoCorrection; Loading @@ -1775,7 +1775,7 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen } mWordComposer.setAutoCorrection(autoCorrection); final boolean isAutoCorrection = suggestedWords.willAutoCorrect(); setSuggestions(suggestedWords, isAutoCorrection); setSuggestionStrip(suggestedWords, isAutoCorrection); setAutoCorrectionIndicator(isAutoCorrection); setSuggestionStripShown(isSuggestionsStripVisible()); } Loading @@ -1783,7 +1783,7 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen private void commitCurrentAutoCorrection(final int separatorCodePoint) { // Complete any pending suggestions query first if (mHandler.hasPendingUpdateSuggestions()) { updateSuggestionsOrPredictions(); updateSuggestionStrip(); } final CharSequence typedAutoCorrection = mWordComposer.getAutoCorrectionOrNull(); final String typedWord = mWordComposer.getTypedWord(); Loading Loading @@ -1930,9 +1930,9 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen private void setPunctuationSuggestions() { if (mCurrentSettings.mBigramPredictionEnabled) { clearSuggestions(); clearSuggestionStrip(); } else { setSuggestions(mCurrentSettings.mSuggestPuncList, false); setSuggestionStrip(mCurrentSettings.mSuggestPuncList, false); } setAutoCorrectionIndicator(false); setSuggestionStripShown(isSuggestionsStripVisible()); Loading Loading
java/src/com/android/inputmethod/latin/LatinIME.java +18 −18 Original line number Diff line number Diff line Loading @@ -206,7 +206,7 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen final KeyboardSwitcher switcher = latinIme.mKeyboardSwitcher; switch (msg.what) { case MSG_UPDATE_SUGGESTION_STRIP: latinIme.updateSuggestionsOrPredictions(); latinIme.updateSuggestionStrip(); break; case MSG_UPDATE_SHIFT_STATE: switcher.updateShiftState(); Loading Loading @@ -862,7 +862,7 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen if (!mCurrentSettings.isApplicationSpecifiedCompletionsOn()) return; mApplicationSpecifiedCompletions = applicationSpecifiedCompletions; if (applicationSpecifiedCompletions == null) { clearSuggestions(); clearSuggestionStrip(); return; } Loading @@ -878,7 +878,7 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen false /* isPrediction */); // When in fullscreen mode, show completions generated by the application final boolean isAutoCorrection = false; setSuggestions(suggestedWords, isAutoCorrection); setSuggestionStrip(suggestedWords, isAutoCorrection); setAutoCorrectionIndicator(isAutoCorrection); // TODO: is this the right thing to do? What should we auto-correct to in // this case? This says to keep whatever the user typed. Loading Loading @@ -988,7 +988,7 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen // the composing word, reset the last composed word, tell the inputconnection about it. private void resetEntireInputState() { resetComposingState(true /* alsoResetLastComposedWord */); clearSuggestions(); clearSuggestionStrip(); mConnection.finishComposingText(); } Loading @@ -1011,7 +1011,7 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen LastComposedWord.COMMIT_TYPE_USER_TYPED_WORD, typedWord.toString(), separatorCode, prevWord); } updateSuggestionsOrPredictions(); updateSuggestionStrip(); } // Called from the KeyboardSwitcher which needs to know auto caps state to display Loading Loading @@ -1332,13 +1332,13 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen @Override public void onUpdateBatchInput(InputPointers batchPointers) { mWordComposer.setBatchInputPointers(batchPointers); updateSuggestionsOrPredictions(); updateSuggestionStrip(); } @Override public void onEndBatchInput(InputPointers batchPointers) { mWordComposer.setBatchInputPointers(batchPointers); final SuggestedWords suggestedWords = updateSuggestionsOrPredictions(); final SuggestedWords suggestedWords = updateSuggestionStrip(); if (suggestedWords == null || suggestedWords.size() == 0) { return; } Loading Loading @@ -1668,12 +1668,12 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen return mCurrentSettings.isSuggestionsRequested(mDisplayOrientation); } private void clearSuggestions() { setSuggestions(SuggestedWords.EMPTY, false); private void clearSuggestionStrip() { setSuggestionStrip(SuggestedWords.EMPTY, false); setAutoCorrectionIndicator(false); } private void setSuggestions(final SuggestedWords words, final boolean isAutoCorrection) { private void setSuggestionStrip(final SuggestedWords words, final boolean isAutoCorrection) { if (mSuggestionStripView != null) { mSuggestionStripView.setSuggestions(words); mKeyboardSwitcher.onAutoCorrectionStateChanged(isAutoCorrection); Loading @@ -1692,7 +1692,7 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen } // TODO: rename this method to updateSuggestionStrip or simply updateSuggestions private SuggestedWords updateSuggestionsOrPredictions() { private SuggestedWords updateSuggestionStrip() { mHandler.cancelUpdateSuggestionStrip(); // Check if we have a suggestion engine attached. Loading Loading @@ -1723,7 +1723,7 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen mCurrentSettings.mCorrectionEnabled); suggestedWords = maybeRetrieveOlderSuggestions(typedWord, suggestedWords); showSuggestions(suggestedWords, typedWord); showSuggestionStrip(suggestedWords, typedWord); return suggestedWords; } Loading Loading @@ -1757,10 +1757,10 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen } } private void showSuggestions(final SuggestedWords suggestedWords, private void showSuggestionStrip(final SuggestedWords suggestedWords, final CharSequence typedWord) { if (null == suggestedWords || suggestedWords.size() <= 0) { clearSuggestions(); clearSuggestionStrip(); return; } final CharSequence autoCorrection; Loading @@ -1775,7 +1775,7 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen } mWordComposer.setAutoCorrection(autoCorrection); final boolean isAutoCorrection = suggestedWords.willAutoCorrect(); setSuggestions(suggestedWords, isAutoCorrection); setSuggestionStrip(suggestedWords, isAutoCorrection); setAutoCorrectionIndicator(isAutoCorrection); setSuggestionStripShown(isSuggestionsStripVisible()); } Loading @@ -1783,7 +1783,7 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen private void commitCurrentAutoCorrection(final int separatorCodePoint) { // Complete any pending suggestions query first if (mHandler.hasPendingUpdateSuggestions()) { updateSuggestionsOrPredictions(); updateSuggestionStrip(); } final CharSequence typedAutoCorrection = mWordComposer.getAutoCorrectionOrNull(); final String typedWord = mWordComposer.getTypedWord(); Loading Loading @@ -1930,9 +1930,9 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen private void setPunctuationSuggestions() { if (mCurrentSettings.mBigramPredictionEnabled) { clearSuggestions(); clearSuggestionStrip(); } else { setSuggestions(mCurrentSettings.mSuggestPuncList, false); setSuggestionStrip(mCurrentSettings.mSuggestPuncList, false); } setAutoCorrectionIndicator(false); setSuggestionStripShown(isSuggestionsStripVisible()); Loading