aboutsummaryrefslogtreecommitdiffstats
path: root/java/src/com/android/inputmethod/latin/LatinIME.java
diff options
context:
space:
mode:
authorYohei Yukawa <yukawa@google.com>2014-04-28 06:58:01 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2014-04-28 06:58:02 +0000
commit91db602b83f5964896f9e1bc31e21ed16f775e4e (patch)
tree2e3f512e9df5fee539f7c8365d71e6ef5374e510 /java/src/com/android/inputmethod/latin/LatinIME.java
parent0b42851eed535929dedaa807cadd971a4efcd47f (diff)
parent8ba4f33709e6c40ade96922f88feace6e4b75b56 (diff)
downloadlatinime-91db602b83f5964896f9e1bc31e21ed16f775e4e.tar.gz
latinime-91db602b83f5964896f9e1bc31e21ed16f775e4e.tar.xz
latinime-91db602b83f5964896f9e1bc31e21ed16f775e4e.zip
Merge "Use shouldOfferSwitchingToNextInputMethod when available"
Diffstat (limited to 'java/src/com/android/inputmethod/latin/LatinIME.java')
-rw-r--r--java/src/com/android/inputmethod/latin/LatinIME.java26
1 files changed, 25 insertions, 1 deletions
diff --git a/java/src/com/android/inputmethod/latin/LatinIME.java b/java/src/com/android/inputmethod/latin/LatinIME.java
index a77cedc48..f1b1b8db2 100644
--- a/java/src/com/android/inputmethod/latin/LatinIME.java
+++ b/java/src/com/android/inputmethod/latin/LatinIME.java
@@ -1229,7 +1229,7 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen
// TODO: Revise the language switch key behavior to make it much smarter and more reasonable.
public void switchToNextSubtype() {
final IBinder token = getWindow().getWindow().getAttributes().token;
- if (mSettings.getCurrent().mIncludesOtherImesInLanguageSwitchList) {
+ if (shouldSwitchToOtherInputMethods()) {
mRichImm.switchToNextInputMethod(token, false /* onlyCurrentIme */);
return;
}
@@ -1799,4 +1799,28 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen
p.println(settingsValues.dump());
// TODO: Dump all settings values
}
+
+ public boolean shouldSwitchToOtherInputMethods() {
+ // TODO: Revisit here to reorganize the settings. Probably we can/should use different
+ // strategy once the implementation of
+ // {@link InputMethodManager#shouldOfferSwitchingToNextInputMethod} is defined well.
+ final boolean fallbackValue = mSettings.getCurrent().mIncludesOtherImesInLanguageSwitchList;
+ final IBinder token = getWindow().getWindow().getAttributes().token;
+ if (token == null) {
+ return fallbackValue;
+ }
+ return mRichImm.shouldOfferSwitchingToNextInputMethod(token, fallbackValue);
+ }
+
+ public boolean shouldShowLanguageSwitchKey() {
+ // TODO: Revisit here to reorganize the settings. Probably we can/should use different
+ // strategy once the implementation of
+ // {@link InputMethodManager#shouldOfferSwitchingToNextInputMethod} is defined well.
+ final boolean fallbackValue = mSettings.getCurrent().isLanguageSwitchKeyEnabled();
+ final IBinder token = getWindow().getWindow().getAttributes().token;
+ if (token == null) {
+ return fallbackValue;
+ }
+ return mRichImm.shouldOfferSwitchingToNextInputMethod(token, fallbackValue);
+ }
}