diff options
Diffstat (limited to 'java')
-rw-r--r-- | java/res/values/styles.xml | 1 | ||||
-rw-r--r-- | java/src/com/android/inputmethod/keyboard/KeyboardSwitcher.java | 12 | ||||
-rw-r--r-- | java/src/com/android/inputmethod/latin/LatinIME.java | 10 |
3 files changed, 11 insertions, 12 deletions
diff --git a/java/res/values/styles.xml b/java/res/values/styles.xml index e3ee36116..3780fe3d2 100644 --- a/java/res/values/styles.xml +++ b/java/res/values/styles.xml @@ -84,6 +84,7 @@ <item name="android:background">@drawable/candidate_feedback_background</item> </style> <style name="CandidateViewStyle" parent="SuggestionsStripBackgroundStyle"> + <item name="autoCorrectHighlight">autoCorrectBold</item> <item name="colorTypedWord">#FFFFFFFF</item> <item name="colorAutoCorrect">#FFFCAE00</item> <item name="colorSuggested">#FFFCAE00</item> diff --git a/java/src/com/android/inputmethod/keyboard/KeyboardSwitcher.java b/java/src/com/android/inputmethod/keyboard/KeyboardSwitcher.java index 50c61ffae..af2220811 100644 --- a/java/src/com/android/inputmethod/keyboard/KeyboardSwitcher.java +++ b/java/src/com/android/inputmethod/keyboard/KeyboardSwitcher.java @@ -782,11 +782,15 @@ public class KeyboardSwitcher implements SharedPreferences.OnSharedPreferenceCha } public void onAutoCorrectionStateChanged(boolean isAutoCorrection) { - if (isAutoCorrection != mIsAutoCorrectionActive) { - LatinKeyboardView keyboardView = getKeyboardView(); + if (mIsAutoCorrectionActive != isAutoCorrection) { mIsAutoCorrectionActive = isAutoCorrection; - keyboardView.invalidateKey(((LatinKeyboard) keyboardView.getKeyboard()) - .onAutoCorrectionStateChanged(isAutoCorrection)); + final LatinKeyboard keyboard = getLatinKeyboard(); + if (keyboard != null && keyboard.needsAutoCorrectionSpacebarLed()) { + final Key invalidatedKey = keyboard.onAutoCorrectionStateChanged(isAutoCorrection); + final LatinKeyboardView keyboardView = getKeyboardView(); + if (keyboardView != null) + keyboardView.invalidateKey(invalidatedKey); + } } } diff --git a/java/src/com/android/inputmethod/latin/LatinIME.java b/java/src/com/android/inputmethod/latin/LatinIME.java index fc01d3976..7446aff9e 100644 --- a/java/src/com/android/inputmethod/latin/LatinIME.java +++ b/java/src/com/android/inputmethod/latin/LatinIME.java @@ -1459,16 +1459,10 @@ public class LatinIME extends InputMethodServiceCompatWrapper implements Keyboar } public void setSuggestions(SuggestedWords words) { -// if (mVoiceProxy.getAndResetIsShowingHint()) { -// setCandidatesView(mCandidateViewContainer); -// } - if (mCandidateView != null) { mCandidateView.setSuggestions(words); - if (mKeyboardSwitcher.getLatinKeyboard().needsAutoCorrectionSpacebarLed()) { - mKeyboardSwitcher.onAutoCorrectionStateChanged( - words.hasWordAboveAutoCorrectionScoreThreshold()); - } + mKeyboardSwitcher.onAutoCorrectionStateChanged( + words.hasWordAboveAutoCorrectionScoreThreshold()); } } |