diff options
author | 2010-03-17 15:36:23 -0700 | |
---|---|---|
committer | 2010-03-17 17:02:28 -0700 | |
commit | 1e5374e98b2707aecd774f495350a74be55ec5dc (patch) | |
tree | ceab6e4cb3b3c0633a6f363db2a0328980c0f9b2 /java/src/com/android/inputmethod/latin/InputLanguageSelection.java | |
parent | c3413faf921cb986f5e421c2e98f54808c3d2cee (diff) | |
download | latinime-1e5374e98b2707aecd774f495350a74be55ec5dc.tar.gz latinime-1e5374e98b2707aecd774f495350a74be55ec5dc.tar.xz latinime-1e5374e98b2707aecd774f495350a74be55ec5dc.zip |
Remove popup for extension keyboard in landscape. bug: 2519903
Also add a summary text in the input language list for languages with
a dictionary so that users don't feel cheated when they pick a language
that doesn't happen to have a dictionary. Remove greek as it isn't an
extension of the QWERTY keyboard.
Diffstat (limited to 'java/src/com/android/inputmethod/latin/InputLanguageSelection.java')
-rw-r--r-- | java/src/com/android/inputmethod/latin/InputLanguageSelection.java | 26 |
1 files changed, 25 insertions, 1 deletions
diff --git a/java/src/com/android/inputmethod/latin/InputLanguageSelection.java b/java/src/com/android/inputmethod/latin/InputLanguageSelection.java index b1ddb2175..b5a11010b 100644 --- a/java/src/com/android/inputmethod/latin/InputLanguageSelection.java +++ b/java/src/com/android/inputmethod/latin/InputLanguageSelection.java @@ -23,6 +23,8 @@ import java.util.Locale; import android.content.SharedPreferences; import android.content.SharedPreferences.Editor; +import android.content.res.Configuration; +import android.content.res.Resources; import android.os.Bundle; import android.preference.CheckBoxPreference; import android.preference.PreferenceActivity; @@ -35,7 +37,7 @@ public class InputLanguageSelection extends PreferenceActivity { private String mSelectedLanguages; private ArrayList<Loc> mAvailableLanguages = new ArrayList<Loc>(); private static final String[] BLACKLIST_LANGUAGES = { - "ko", "ja", "zh" + "ko", "ja", "zh", "el" }; private static class Loc implements Comparable { @@ -75,6 +77,9 @@ public class InputLanguageSelection extends PreferenceActivity { pref.setTitle(LanguageSwitcher.toTitleCase(locale.getDisplayName(locale))); boolean checked = isLocaleIn(locale, languageList); pref.setChecked(checked); + if (hasDictionary(locale)) { + pref.setSummary(R.string.has_dictionary); + } parent.addPreference(pref); } } @@ -92,6 +97,25 @@ public class InputLanguageSelection extends PreferenceActivity { return false; } + private boolean hasDictionary(Locale locale) { + Resources res = getResources(); + Configuration conf = res.getConfiguration(); + Locale saveLocale = conf.locale; + boolean haveDictionary = false; + conf.locale = locale; + res.updateConfiguration(conf, res.getDisplayMetrics()); + BinaryDictionary bd = new BinaryDictionary(this, R.raw.main); + // Is the dictionary larger than a placeholder? Arbitrarily chose a lower limit of + // 4000-5000 words, whereas the LARGE_DICTIONARY is about 20000+ words. + if (bd.getSize() > Suggest.LARGE_DICTIONARY_THRESHOLD / 4) { + haveDictionary = true; + } + bd.close(); + conf.locale = saveLocale; + res.updateConfiguration(conf, res.getDisplayMetrics()); + return haveDictionary; + } + private String get5Code(Locale locale) { String country = locale.getCountry(); return locale.getLanguage() |