diff options
author | 2010-08-31 18:00:09 +0900 | |
---|---|---|
committer | 2010-09-01 11:25:08 +0900 | |
commit | 543dbdfdbda259aa56be9670480c7d802beba332 (patch) | |
tree | 84cd6208ca4d4fb65493167b5adc7fe161c5a407 /java/src | |
parent | b24cc640c1485590b1e9912397ea9acd68b43d99 (diff) | |
download | latinime-543dbdfdbda259aa56be9670480c7d802beba332.tar.gz latinime-543dbdfdbda259aa56be9670480c7d802beba332.tar.xz latinime-543dbdfdbda259aa56be9670480c7d802beba332.zip |
Always present suggestion strip whenever in appropriate mode.
Some cleanups too.
bug: 2959293
Change-Id: Idf07fc25c5700b69b93ab4b09ce34941f0d9c157
Diffstat (limited to 'java/src')
-rw-r--r-- | java/src/com/android/inputmethod/latin/LatinIME.java | 27 |
1 files changed, 14 insertions, 13 deletions
diff --git a/java/src/com/android/inputmethod/latin/LatinIME.java b/java/src/com/android/inputmethod/latin/LatinIME.java index f26cbc059..74ed90ff6 100644 --- a/java/src/com/android/inputmethod/latin/LatinIME.java +++ b/java/src/com/android/inputmethod/latin/LatinIME.java @@ -647,16 +647,14 @@ public class LatinIME extends InputMethodService (attribute.inputType & EditorInfo.TYPE_TEXT_FLAG_MULTI_LINE) == 0) { mInputTypeNoAutoCorrect = true; } - if ((attribute.inputType&EditorInfo.TYPE_TEXT_FLAG_AUTO_COMPLETE) != 0) { + if ((attribute.inputType & EditorInfo.TYPE_TEXT_FLAG_AUTO_COMPLETE) != 0) { mPredictionOn = false; - mCompletionOn = true && isFullscreenMode(); + mCompletionOn = isFullscreenMode(); } - updateShiftKeyState(attribute); break; default: mKeyboardSwitcher.setKeyboardMode(KeyboardSwitcher.MODE_TEXT, attribute.imeOptions, enableVoiceButton); - updateShiftKeyState(attribute); } inputView.closing(); mComposing.setLength(0); @@ -666,8 +664,9 @@ public class LatinIME extends InputMethodService loadSettings(); updateShiftKeyState(attribute); - setCandidatesViewShown(false); - setSuggestions(null, false, false, false); + setCandidatesViewShownInternal(isCandidateStripVisible() || mCompletionOn, + false /* needsInputViewShown */ ); + updateSuggestions(); // If the dictionary is not big enough, don't auto correct mHasDictionary = mSuggest.hasMainDictionary(); @@ -831,21 +830,24 @@ public class LatinIME extends InputMethodService // When in fullscreen mode, show completions generated by the application setSuggestions(stringList, true, true, true); mBestWord = null; - setCandidatesViewShown(isCandidateStripVisible() || mCompletionOn); + setCandidatesViewShown(true); } } - @Override - public void setCandidatesViewShown(boolean shown) { + private void setCandidatesViewShownInternal(boolean shown, boolean needsInputViewShown) { // TODO: Remove this if we support candidates with hard keyboard if (onEvaluateInputViewShown()) { - // Show the candidates view only if input view is showing super.setCandidatesViewShown(shown && mKeyboardSwitcher.getInputView() != null - && mKeyboardSwitcher.getInputView().isShown()); + && (needsInputViewShown ? mKeyboardSwitcher.getInputView().isShown() : true)); } } @Override + public void setCandidatesViewShown(boolean shown) { + setCandidatesViewShownInternal(shown, true /* needsInputViewShown */ ); + } + + @Override public void onComputeInsets(InputMethodService.Insets outInsets) { super.onComputeInsets(outInsets); if (!isFullscreenMode()) { @@ -1430,8 +1432,7 @@ public class LatinIME extends InputMethodService } private boolean isPredictionOn() { - boolean predictionOn = mPredictionOn; - return predictionOn; + return mPredictionOn; } private boolean isCandidateStripVisible() { |