Loading java/src/com/android/inputmethod/latin/KeyboardSwitcher.java +2 −1 Original line number Diff line number Diff line Loading @@ -260,7 +260,8 @@ public class KeyboardSwitcher implements SharedPreferences.OnSharedPreferenceCha mMode = mode; mImeOptions = imeOptions; if (enableVoice != mHasVoice) { setVoiceMode(mHasVoice, mVoiceOnPrimary); // TODO clean up this unnecessary recursive call. setVoiceMode(enableVoice, mVoiceOnPrimary); } mIsSymbols = isSymbols; Loading java/src/com/android/inputmethod/latin/LatinIME.java +2 −2 Original line number Diff line number Diff line Loading @@ -2329,8 +2329,8 @@ public class LatinIME extends InputMethodService private boolean shouldShowVoiceButton(FieldContext fieldContext, EditorInfo attribute) { return ENABLE_VOICE_BUTTON && fieldCanDoVoice(fieldContext) && !(attribute != null && attribute.privateImeOptions != null && attribute.privateImeOptions.equals(IME_OPTION_NO_MICROPHONE)) && !(attribute != null && IME_OPTION_NO_MICROPHONE.equals(attribute.privateImeOptions)) && SpeechRecognizer.isRecognitionAvailable(this); } Loading java/src/com/android/inputmethod/latin/LatinKeyboard.java +24 −21 Original line number Diff line number Diff line Loading @@ -336,7 +336,7 @@ public class LatinKeyboard extends Keyboard { mMicIcon = mRes.getDrawable(R.drawable.sym_keyboard_mic); m123MicIcon = mRes.getDrawable(R.drawable.sym_keyboard_123_mic); } updateF1Key(); updateDynamicKeys(); if (mSpaceKey != null) { updateSpaceBarForLocale(isAutoCompletion, isBlack); } Loading @@ -350,11 +350,11 @@ public class LatinKeyboard extends Keyboard { public void setVoiceMode(boolean hasVoiceButton, boolean hasVoice) { mHasVoiceButton = hasVoiceButton; mVoiceEnabled = hasVoice; updateF1Key(); updateDynamicKeys(); } private void updateF1Key() { if (mF1Key == null) return; private void updateDynamicKeys() { // Update KEYCODE_MODE_CHANGE key only on alphabet mode, not on symbol mode. if (m123Key != null && mIsAlphaKeyboard) { if (mVoiceEnabled && !mHasVoiceButton) { m123Key.icon = m123MicIcon; Loading @@ -367,6 +367,8 @@ public class LatinKeyboard extends Keyboard { } } // Update KEYCODE_F1 key. Please note that some keyboard layout has no F1 key. if (mF1Key != null) { if (mHasVoiceButton && mVoiceEnabled) { mF1Key.codes = new int[] { LatinKeyboardView.KEYCODE_VOICE }; mF1Key.label = null; Loading @@ -378,14 +380,15 @@ public class LatinKeyboard extends Keyboard { } else { mF1Key.label = ","; mF1Key.codes = new int[] { ',' }; // HACK: draw only mF1HintIcon on offscreen buffer to adjust position of '...' to the // above synthesized icon // HACK: draw only mF1HintIcon on offscreen buffer to adjust position of '...' to // the above synthesized icon mF1Key.icon = new BitmapDrawable(mRes, drawSynthesizedSettingsHintImage( mF1Key.width, mF1Key.height + mVerticalGap, null, mF1HintIcon)); mF1Key.iconPreview = null; mF1Key.popupResId = R.xml.popup_comma; } } } /** * @return a key which should be invalidated. Loading Loading
java/src/com/android/inputmethod/latin/KeyboardSwitcher.java +2 −1 Original line number Diff line number Diff line Loading @@ -260,7 +260,8 @@ public class KeyboardSwitcher implements SharedPreferences.OnSharedPreferenceCha mMode = mode; mImeOptions = imeOptions; if (enableVoice != mHasVoice) { setVoiceMode(mHasVoice, mVoiceOnPrimary); // TODO clean up this unnecessary recursive call. setVoiceMode(enableVoice, mVoiceOnPrimary); } mIsSymbols = isSymbols; Loading
java/src/com/android/inputmethod/latin/LatinIME.java +2 −2 Original line number Diff line number Diff line Loading @@ -2329,8 +2329,8 @@ public class LatinIME extends InputMethodService private boolean shouldShowVoiceButton(FieldContext fieldContext, EditorInfo attribute) { return ENABLE_VOICE_BUTTON && fieldCanDoVoice(fieldContext) && !(attribute != null && attribute.privateImeOptions != null && attribute.privateImeOptions.equals(IME_OPTION_NO_MICROPHONE)) && !(attribute != null && IME_OPTION_NO_MICROPHONE.equals(attribute.privateImeOptions)) && SpeechRecognizer.isRecognitionAvailable(this); } Loading
java/src/com/android/inputmethod/latin/LatinKeyboard.java +24 −21 Original line number Diff line number Diff line Loading @@ -336,7 +336,7 @@ public class LatinKeyboard extends Keyboard { mMicIcon = mRes.getDrawable(R.drawable.sym_keyboard_mic); m123MicIcon = mRes.getDrawable(R.drawable.sym_keyboard_123_mic); } updateF1Key(); updateDynamicKeys(); if (mSpaceKey != null) { updateSpaceBarForLocale(isAutoCompletion, isBlack); } Loading @@ -350,11 +350,11 @@ public class LatinKeyboard extends Keyboard { public void setVoiceMode(boolean hasVoiceButton, boolean hasVoice) { mHasVoiceButton = hasVoiceButton; mVoiceEnabled = hasVoice; updateF1Key(); updateDynamicKeys(); } private void updateF1Key() { if (mF1Key == null) return; private void updateDynamicKeys() { // Update KEYCODE_MODE_CHANGE key only on alphabet mode, not on symbol mode. if (m123Key != null && mIsAlphaKeyboard) { if (mVoiceEnabled && !mHasVoiceButton) { m123Key.icon = m123MicIcon; Loading @@ -367,6 +367,8 @@ public class LatinKeyboard extends Keyboard { } } // Update KEYCODE_F1 key. Please note that some keyboard layout has no F1 key. if (mF1Key != null) { if (mHasVoiceButton && mVoiceEnabled) { mF1Key.codes = new int[] { LatinKeyboardView.KEYCODE_VOICE }; mF1Key.label = null; Loading @@ -378,14 +380,15 @@ public class LatinKeyboard extends Keyboard { } else { mF1Key.label = ","; mF1Key.codes = new int[] { ',' }; // HACK: draw only mF1HintIcon on offscreen buffer to adjust position of '...' to the // above synthesized icon // HACK: draw only mF1HintIcon on offscreen buffer to adjust position of '...' to // the above synthesized icon mF1Key.icon = new BitmapDrawable(mRes, drawSynthesizedSettingsHintImage( mF1Key.width, mF1Key.height + mVerticalGap, null, mF1HintIcon)); mF1Key.iconPreview = null; mF1Key.popupResId = R.xml.popup_comma; } } } /** * @return a key which should be invalidated. Loading