Loading java/src/com/android/inputmethod/latin/KeyboardSwitcher.java +14 −11 Original line number Diff line number Diff line Loading @@ -16,10 +16,6 @@ package com.android.inputmethod.latin; import java.util.HashMap; import java.util.Locale; import java.util.Map; import android.content.Context; import android.content.SharedPreferences; import android.content.res.Configuration; Loading @@ -27,6 +23,10 @@ import android.content.res.Resources; import android.preference.PreferenceManager; import android.view.InflateException; import java.util.HashMap; import java.util.Locale; import java.util.Map; public class KeyboardSwitcher implements SharedPreferences.OnSharedPreferenceChangeListener { public static final int MODE_NONE = 0; Loading Loading @@ -197,8 +197,7 @@ public class KeyboardSwitcher implements SharedPreferences.OnSharedPreferenceCha } mHasVoice = enableVoice; mVoiceOnPrimary = voiceOnPrimary; setKeyboardMode(mMode, mImeOptions, mHasVoice, mIsSymbols); setKeyboardMode(mMode, mImeOptions, mHasVoice, mIsSymbols); } boolean hasVoiceButton(boolean isSymbols) { Loading Loading @@ -338,19 +337,23 @@ public class KeyboardSwitcher implements SharedPreferences.OnSharedPreferenceCha void toggleShift() { if (mCurrentId.equals(mSymbolsId)) { LatinKeyboard symbolsKeyboard = getKeyboard(mSymbolsId); LatinKeyboard symbolsShiftedKeyboard = getKeyboard(mSymbolsShiftedId); symbolsKeyboard.setShifted(true); mCurrentId = mSymbolsShiftedId; mInputView.setKeyboard(symbolsShiftedKeyboard); symbolsShiftedKeyboard.setShifted(true); // Symbol shifted keyboard has an ALT key that has a caps lock style indicator. To // enable the indicator, we need to call enableShiftLock() and setShiftLocked(true). // Thus we can keep the ALT key's Key.on value true while LatinKey.onRelease() is // called. symbolsShiftedKeyboard.enableShiftLock(); symbolsShiftedKeyboard.setShiftLocked(true); symbolsShiftedKeyboard.setImeOptions(mContext.getResources(), mMode, mImeOptions); } else if (mCurrentId.equals(mSymbolsShiftedId)) { LatinKeyboard symbolsKeyboard = getKeyboard(mSymbolsId); LatinKeyboard symbolsShiftedKeyboard = getKeyboard(mSymbolsShiftedId); symbolsShiftedKeyboard.setShifted(false); mCurrentId = mSymbolsId; mInputView.setKeyboard(symbolsKeyboard); // Symbol keyboard has an ALT key that has a caps lock style indicator. To disable the // indicator, we need to call enableShiftLock() and setShiftLocked(false). symbolsKeyboard.enableShiftLock(); symbolsKeyboard.setShifted(false); symbolsKeyboard.setImeOptions(mContext.getResources(), mMode, mImeOptions); } Loading java/src/com/android/inputmethod/latin/LatinKeyboard.java +5 −5 Original line number Diff line number Diff line Loading @@ -16,9 +16,6 @@ package com.android.inputmethod.latin; import java.util.List; import java.util.Locale; import android.content.Context; import android.content.res.Resources; import android.content.res.TypedArray; Loading @@ -27,10 +24,10 @@ import android.graphics.Bitmap; import android.graphics.Canvas; import android.graphics.ColorFilter; import android.graphics.Paint; import android.graphics.Paint.Align; import android.graphics.PixelFormat; import android.graphics.PorterDuff; import android.graphics.Rect; import android.graphics.Paint.Align; import android.graphics.drawable.BitmapDrawable; import android.graphics.drawable.Drawable; import android.inputmethodservice.Keyboard; Loading @@ -39,6 +36,9 @@ import android.util.Log; import android.view.ViewConfiguration; import android.view.inputmethod.EditorInfo; import java.util.List; import java.util.Locale; public class LatinKeyboard extends Keyboard { private static final boolean DEBUG_PREFERRED_LETTER = false; Loading Loading @@ -128,7 +128,7 @@ public class LatinKeyboard extends Keyboard { R.dimen.spacebar_vertical_correction); mIsAlphaKeyboard = xmlLayoutResId == R.xml.kbd_qwerty || xmlLayoutResId == R.xml.kbd_qwerty_black; mSpaceKeyIndex = indexOf((int) ' '); mSpaceKeyIndex = indexOf(' '); } public LatinKeyboard(Context context, int layoutTemplateResId, Loading java/src/com/android/inputmethod/latin/LatinKeyboardView.java +1 −1 Original line number Diff line number Diff line Loading @@ -131,7 +131,7 @@ public class LatinKeyboardView extends LatinKeyboardBaseView { public boolean setShiftLocked(boolean shiftLocked) { Keyboard keyboard = getKeyboard(); if (keyboard != null && keyboard instanceof LatinKeyboard) { if (keyboard instanceof LatinKeyboard) { ((LatinKeyboard)keyboard).setShiftLocked(shiftLocked); invalidateAllKeys(); return true; Loading Loading
java/src/com/android/inputmethod/latin/KeyboardSwitcher.java +14 −11 Original line number Diff line number Diff line Loading @@ -16,10 +16,6 @@ package com.android.inputmethod.latin; import java.util.HashMap; import java.util.Locale; import java.util.Map; import android.content.Context; import android.content.SharedPreferences; import android.content.res.Configuration; Loading @@ -27,6 +23,10 @@ import android.content.res.Resources; import android.preference.PreferenceManager; import android.view.InflateException; import java.util.HashMap; import java.util.Locale; import java.util.Map; public class KeyboardSwitcher implements SharedPreferences.OnSharedPreferenceChangeListener { public static final int MODE_NONE = 0; Loading Loading @@ -197,8 +197,7 @@ public class KeyboardSwitcher implements SharedPreferences.OnSharedPreferenceCha } mHasVoice = enableVoice; mVoiceOnPrimary = voiceOnPrimary; setKeyboardMode(mMode, mImeOptions, mHasVoice, mIsSymbols); setKeyboardMode(mMode, mImeOptions, mHasVoice, mIsSymbols); } boolean hasVoiceButton(boolean isSymbols) { Loading Loading @@ -338,19 +337,23 @@ public class KeyboardSwitcher implements SharedPreferences.OnSharedPreferenceCha void toggleShift() { if (mCurrentId.equals(mSymbolsId)) { LatinKeyboard symbolsKeyboard = getKeyboard(mSymbolsId); LatinKeyboard symbolsShiftedKeyboard = getKeyboard(mSymbolsShiftedId); symbolsKeyboard.setShifted(true); mCurrentId = mSymbolsShiftedId; mInputView.setKeyboard(symbolsShiftedKeyboard); symbolsShiftedKeyboard.setShifted(true); // Symbol shifted keyboard has an ALT key that has a caps lock style indicator. To // enable the indicator, we need to call enableShiftLock() and setShiftLocked(true). // Thus we can keep the ALT key's Key.on value true while LatinKey.onRelease() is // called. symbolsShiftedKeyboard.enableShiftLock(); symbolsShiftedKeyboard.setShiftLocked(true); symbolsShiftedKeyboard.setImeOptions(mContext.getResources(), mMode, mImeOptions); } else if (mCurrentId.equals(mSymbolsShiftedId)) { LatinKeyboard symbolsKeyboard = getKeyboard(mSymbolsId); LatinKeyboard symbolsShiftedKeyboard = getKeyboard(mSymbolsShiftedId); symbolsShiftedKeyboard.setShifted(false); mCurrentId = mSymbolsId; mInputView.setKeyboard(symbolsKeyboard); // Symbol keyboard has an ALT key that has a caps lock style indicator. To disable the // indicator, we need to call enableShiftLock() and setShiftLocked(false). symbolsKeyboard.enableShiftLock(); symbolsKeyboard.setShifted(false); symbolsKeyboard.setImeOptions(mContext.getResources(), mMode, mImeOptions); } Loading
java/src/com/android/inputmethod/latin/LatinKeyboard.java +5 −5 Original line number Diff line number Diff line Loading @@ -16,9 +16,6 @@ package com.android.inputmethod.latin; import java.util.List; import java.util.Locale; import android.content.Context; import android.content.res.Resources; import android.content.res.TypedArray; Loading @@ -27,10 +24,10 @@ import android.graphics.Bitmap; import android.graphics.Canvas; import android.graphics.ColorFilter; import android.graphics.Paint; import android.graphics.Paint.Align; import android.graphics.PixelFormat; import android.graphics.PorterDuff; import android.graphics.Rect; import android.graphics.Paint.Align; import android.graphics.drawable.BitmapDrawable; import android.graphics.drawable.Drawable; import android.inputmethodservice.Keyboard; Loading @@ -39,6 +36,9 @@ import android.util.Log; import android.view.ViewConfiguration; import android.view.inputmethod.EditorInfo; import java.util.List; import java.util.Locale; public class LatinKeyboard extends Keyboard { private static final boolean DEBUG_PREFERRED_LETTER = false; Loading Loading @@ -128,7 +128,7 @@ public class LatinKeyboard extends Keyboard { R.dimen.spacebar_vertical_correction); mIsAlphaKeyboard = xmlLayoutResId == R.xml.kbd_qwerty || xmlLayoutResId == R.xml.kbd_qwerty_black; mSpaceKeyIndex = indexOf((int) ' '); mSpaceKeyIndex = indexOf(' '); } public LatinKeyboard(Context context, int layoutTemplateResId, Loading
java/src/com/android/inputmethod/latin/LatinKeyboardView.java +1 −1 Original line number Diff line number Diff line Loading @@ -131,7 +131,7 @@ public class LatinKeyboardView extends LatinKeyboardBaseView { public boolean setShiftLocked(boolean shiftLocked) { Keyboard keyboard = getKeyboard(); if (keyboard != null && keyboard instanceof LatinKeyboard) { if (keyboard instanceof LatinKeyboard) { ((LatinKeyboard)keyboard).setShiftLocked(shiftLocked); invalidateAllKeys(); return true; Loading