aboutsummaryrefslogtreecommitdiffstats
path: root/java/src
diff options
context:
space:
mode:
authorJean Chalard <jchalard@google.com>2012-03-15 15:53:55 +0900
committerJean Chalard <jchalard@google.com>2012-03-15 15:54:25 +0900
commit2be7a37acfd498bfc83347597bfb8cb216a310eb (patch)
tree844f57d8a0a2d64c033b57c810eaad5a5c388e7a /java/src
parent7c5f2bbd2a44176cb54b90aa05a0af46e79e83d8 (diff)
downloadlatinime-2be7a37acfd498bfc83347597bfb8cb216a310eb.tar.gz
latinime-2be7a37acfd498bfc83347597bfb8cb216a310eb.tar.xz
latinime-2be7a37acfd498bfc83347597bfb8cb216a310eb.zip
Small cleanup
Exit-fast, update comment, make a method private Change-Id: Id103bf03aeef43a1a4d064ecabb819490dc5d39a
Diffstat (limited to 'java/src')
-rw-r--r--java/src/com/android/inputmethod/latin/LatinIME.java20
1 files changed, 9 insertions, 11 deletions
diff --git a/java/src/com/android/inputmethod/latin/LatinIME.java b/java/src/com/android/inputmethod/latin/LatinIME.java
index 42dd766fa..c35c96016 100644
--- a/java/src/com/android/inputmethod/latin/LatinIME.java
+++ b/java/src/com/android/inputmethod/latin/LatinIME.java
@@ -1716,7 +1716,7 @@ public class LatinIME extends InputMethodServiceCompatWrapper implements Keyboar
setAutoCorrectionIndicator(false);
}
- public void setSuggestions(final SuggestedWords words, final boolean isAutoCorrection) {
+ private void setSuggestions(final SuggestedWords words, final boolean isAutoCorrection) {
if (mSuggestionsView != null) {
mSuggestionsView.setSuggestions(words);
mKeyboardSwitcher.onAutoCorrectionStateChanged(isAutoCorrection);
@@ -1726,15 +1726,13 @@ public class LatinIME extends InputMethodServiceCompatWrapper implements Keyboar
private void setAutoCorrectionIndicator(final boolean newAutoCorrectionIndicator) {
// Put a blue underline to a word in TextView which will be auto-corrected.
final InputConnection ic = getCurrentInputConnection();
- if (ic != null) {
- if (mIsAutoCorrectionIndicatorOn != newAutoCorrectionIndicator) {
- if (mWordComposer.isComposingWord()) {
- mIsAutoCorrectionIndicatorOn = newAutoCorrectionIndicator;
- final CharSequence textWithUnderline =
- getTextWithUnderline(mWordComposer.getTypedWord());
- ic.setComposingText(textWithUnderline, 1);
- }
- }
+ if (ic == null) return;
+ if (mIsAutoCorrectionIndicatorOn != newAutoCorrectionIndicator
+ && mWordComposer.isComposingWord()) {
+ mIsAutoCorrectionIndicatorOn = newAutoCorrectionIndicator;
+ final CharSequence textWithUnderline =
+ getTextWithUnderline(mWordComposer.getTypedWord());
+ ic.setComposingText(textWithUnderline, 1);
}
}
@@ -1767,7 +1765,7 @@ public class LatinIME extends InputMethodServiceCompatWrapper implements Keyboar
}
final CharSequence typedWord = mWordComposer.getTypedWord();
- // getSuggestedWordBuilder handles gracefully a null value of prevWord
+ // getSuggestedWords handles gracefully a null value of prevWord
final SuggestedWords suggestedWords = mSuggest.getSuggestedWords(mWordComposer,
prevWord, mKeyboardSwitcher.getKeyboard().getProximityInfo(), mCorrectionMode);