aboutsummaryrefslogtreecommitdiffstats
path: root/src/com/android/inputmethod/latin/KeyboardSwitcher.java
diff options
context:
space:
mode:
authorAmith Yamasani <yamasani@google.com>2010-01-29 20:09:49 -0800
committerAmith Yamasani <yamasani@google.com>2010-02-01 09:49:24 -0800
commit3f7d75060afb2bb7e74879bcbbdcb9700ec5c2d6 (patch)
treee874805b667ed13d257b7b29cfa6ea19a905fa29 /src/com/android/inputmethod/latin/KeyboardSwitcher.java
parent41a519729505a877844f2c57a33509c302dddbce (diff)
downloadlatinime-3f7d75060afb2bb7e74879bcbbdcb9700ec5c2d6.tar.gz
latinime-3f7d75060afb2bb7e74879bcbbdcb9700ec5c2d6.tar.xz
latinime-3f7d75060afb2bb7e74879bcbbdcb9700ec5c2d6.zip
Language switching with slide gesture on spacebar. Bug: 2331173
Shows the language on the spacebar and in the preview bubble. Allows dragging of the spacebar from side to side to switch to previous or next languages.
Diffstat (limited to 'src/com/android/inputmethod/latin/KeyboardSwitcher.java')
-rw-r--r--src/com/android/inputmethod/latin/KeyboardSwitcher.java14
1 files changed, 6 insertions, 8 deletions
diff --git a/src/com/android/inputmethod/latin/KeyboardSwitcher.java b/src/com/android/inputmethod/latin/KeyboardSwitcher.java
index ea473f223..0ebfe4a9a 100644
--- a/src/com/android/inputmethod/latin/KeyboardSwitcher.java
+++ b/src/com/android/inputmethod/latin/KeyboardSwitcher.java
@@ -77,6 +77,7 @@ public class KeyboardSwitcher {
private int mSymbolsModeState = SYMBOLS_MODE_STATE_NONE;
private int mLastDisplayWidth;
+ private LanguageSwitcher mLanguageSwitcher;
private Locale mInputLocale;
private boolean mEnableMultipleLanguages;
@@ -94,9 +95,10 @@ public class KeyboardSwitcher {
* @param locale the current input locale, or null for default locale with no locale
* button.
*/
- void setInputLocale(Locale locale, boolean enableMultipleLanguages) {
- mInputLocale = locale;
- mEnableMultipleLanguages = enableMultipleLanguages;
+ void setLanguageSwitcher(LanguageSwitcher languageSwitcher) {
+ mLanguageSwitcher = languageSwitcher;
+ mInputLocale = mLanguageSwitcher.getInputLocale();
+ mEnableMultipleLanguages = mLanguageSwitcher.getLocaleCount() > 1;
}
void setInputView(LatinKeyboardView inputView) {
@@ -195,11 +197,6 @@ public class KeyboardSwitcher {
}
mCurrentId = id;
- if (mEnableMultipleLanguages) {
- keyboard.setLanguage(mInputLocale);
- } else {
- keyboard.setLanguage(null);
- }
mInputView.setKeyboard(keyboard);
keyboard.setShifted(false);
keyboard.setShiftLocked(keyboard.isShiftLocked());
@@ -215,6 +212,7 @@ public class KeyboardSwitcher {
orig.updateConfiguration(conf, null);
LatinKeyboard keyboard = new LatinKeyboard(
mContext, id.mXml, id.mKeyboardMode, id.mHasVoice);
+ keyboard.setLanguageSwitcher(mLanguageSwitcher);
if (id.mKeyboardMode == KEYBOARDMODE_NORMAL
|| id.mKeyboardMode == KEYBOARDMODE_URL
|| id.mKeyboardMode == KEYBOARDMODE_IM