diff options
Diffstat (limited to 'java')
20 files changed, 170 insertions, 78 deletions
diff --git a/java/res/raw/main_de.dict b/java/res/raw/main_de.dict Binary files differindex 1a7b305d6..6122cd3f0 100644 --- a/java/res/raw/main_de.dict +++ b/java/res/raw/main_de.dict diff --git a/java/res/raw/main_en.dict b/java/res/raw/main_en.dict Binary files differindex 516e7d51c..c96276e04 100644 --- a/java/res/raw/main_en.dict +++ b/java/res/raw/main_en.dict diff --git a/java/res/raw/main_fr.dict b/java/res/raw/main_fr.dict Binary files differindex 17920f0b2..717078c93 100644 --- a/java/res/raw/main_fr.dict +++ b/java/res/raw/main_fr.dict diff --git a/java/res/raw/main_it.dict b/java/res/raw/main_it.dict Binary files differindex 00bbdbe90..82579078c 100644 --- a/java/res/raw/main_it.dict +++ b/java/res/raw/main_it.dict diff --git a/java/res/values-en/whitelist.xml b/java/res/values-en/whitelist.xml index 9612aac5d..262017916 100644 --- a/java/res/values-en/whitelist.xml +++ b/java/res/values-en/whitelist.xml @@ -30,7 +30,6 @@ <item>ill</item> <item>I\'ll</item> - <!-- Following entries came from AutoText the Android keyboard no longer uses. --> <!-- TODO: Trim down more entries by removing ones that get auto-corrected by the Android keyboard's own typing error correction algorithms. --> @@ -63,22 +62,62 @@ <item>been</item> <item>255</item> + <item>bot</item> + <item>not</item> + + <item>255</item> <item>bur</item> <item>but</item> <item>255</item> + <item>cam</item> + <item>can</item> + + <item>255</item> <item>cant</item> <item>can\'t</item> <item>255</item> + <item>dame</item> + <item>same</item> + + <item>255</item> <item>didint</item> <item>didn\'t</item> <item>255</item> + <item>dormer</item> + <item>former</item> + + <item>255</item> + <item>dud</item> + <item>did</item> + + <item>255</item> + <item>fay</item> + <item>day</item> + + <item>255</item> + <item>fife</item> + <item>five</item> + + <item>255</item> + <item>foo</item> + <item>for</item> + + <item>255</item> <item>fora</item> <item>for a</item> <item>255</item> + <item>galled</item> + <item>called</item> + + <item>255</item> + <item>goo</item> + <item>too</item> + + <item>255</item> <item>hed</item> <item>he\'d</item> @@ -91,6 +130,10 @@ <item>here\'s</item> <item>255</item> + <item>hew</item> + <item>new</item> + + <item>255</item> <item>hoe</item> <item>how</item> @@ -115,10 +158,18 @@ <item>how\'ve</item> <item>255</item> + <item>hum</item> + <item>him</item> + + <item>255</item> <item>i</item> <item>I</item> <item>255</item> + <item>ifs</item> + <item>its</item> + + <item>255</item> <item>il</item> <item>I\'ll</item> @@ -139,10 +190,6 @@ <item>it\'s a</item> <item>255</item> - <item>jot</item> - <item>not</item> - - <item>255</item> <item>lets</item> <item>let\'s</item> @@ -151,6 +198,18 @@ <item>ma\'am</item> <item>255</item> + <item>manu</item> + <item>many</item> + + <item>255</item> + <item>mare</item> + <item>made</item> + + <item>255</item> + <item>mew</item> + <item>new</item> + + <item>255</item> <item>mire</item> <item>more</item> @@ -171,14 +230,46 @@ <item>notes</item> <item>255</item> + <item>mow</item> + <item>now</item> + + <item>255</item> + <item>namer</item> + <item>named</item> + + <item>255</item> + <item>nave</item> + <item>have</item> + + <item>255</item> + <item>nee</item> + <item>new</item> + + <item>255</item> + <item>nigh</item> + <item>high</item> + + <item>255</item> <item>nit</item> <item>not</item> <item>255</item> + <item>oft</item> + <item>off</item> + + <item>255</item> <item>os</item> <item>is</item> <item>255</item> + <item>pater</item> + <item>later</item> + + <item>255</item> + <item>rook</item> + <item>took</item> + + <item>255</item> <item>shel</item> <item>she\'ll</item> @@ -187,6 +278,14 @@ <item>shouldn\'t</item> <item>255</item> + <item>sill</item> + <item>will</item> + + <item>255</item> + <item>sown</item> + <item>down</item> + + <item>255</item> <item>thatd</item> <item>that\'d</item> @@ -305,10 +404,6 @@ <item>y\'all</item> <item>255</item> - <item>yo</item> - <item>to</item> - - <item>255</item> <item>youd</item> <item>you\'d</item> diff --git a/java/res/values-tr/strings.xml b/java/res/values-tr/strings.xml index 39737f55e..b2f73912e 100644 --- a/java/res/values-tr/strings.xml +++ b/java/res/values-tr/strings.xml @@ -40,15 +40,15 @@ <string name="include_other_imes_in_language_switch_list" msgid="4533689960308565519">"Diğer giriş yöntemine geç"</string> <string name="include_other_imes_in_language_switch_list_summary" msgid="840637129103317635">"Dil geçiş tuşu diğer giriş yöntemlerini de kapsar"</string> <string name="suppress_language_switch_key" msgid="8003788410354806368">"Dil geçiş tuşunu gösterme"</string> - <string name="key_preview_popup_dismiss_delay" msgid="6213164897443068248">"Tuş popup içn kaptm ertlm"</string> + <string name="key_preview_popup_dismiss_delay" msgid="6213164897443068248">"Tuş popup\'ının kapatılmasını geciktirme"</string> <string name="key_preview_popup_dismiss_no_delay" msgid="2096123151571458064">"Gecikme yok"</string> <string name="key_preview_popup_dismiss_default_delay" msgid="2166964333903906734">"Varsayılan"</string> <string name="use_contacts_dict" msgid="4435317977804180815">"Kişi Adları öner"</string> <string name="use_contacts_dict_summary" msgid="6599983334507879959">"Öneri ve düzeltmeler için Kişiler\'deki adları kullan"</string> <string name="enable_span_insert" msgid="7204653105667167620">"Düzeltmeleri etkinleştir"</string> <string name="enable_span_insert_summary" msgid="2947317657871394467">"Yeniden düzeltmeler için önerileri ayarla"</string> - <string name="auto_cap" msgid="1719746674854628252">"Otomatik olarak büyük harf yap"</string> - <string name="configure_dictionaries_title" msgid="4238652338556902049">"Ekli sözlükler"</string> + <string name="auto_cap" msgid="1719746674854628252">"Otomatik olarak büyük fark yap"</string> + <string name="configure_dictionaries_title" msgid="4238652338556902049">"Ek sözlükler"</string> <string name="main_dictionary" msgid="4798763781818361168">"Ana sözlük"</string> <string name="prefs_show_suggestions" msgid="8026799663445531637">"Düzeltme önerilerini göster"</string> <string name="prefs_show_suggestions_summary" msgid="1583132279498502825">"Yazarken, önerilen kelimeleri görüntüle"</string> @@ -56,7 +56,7 @@ <string name="prefs_suggestion_visibility_show_only_portrait_name" msgid="3551821800439659812">"Dikey modda göster"</string> <string name="prefs_suggestion_visibility_hide_name" msgid="6309143926422234673">"Her zaman gizle"</string> <string name="auto_correction" msgid="4979925752001319458">"Otomatik düzeltme"</string> - <string name="auto_correction_summary" msgid="5625751551134658006">"Boşluk çbğ ve nokt işr yanlış yazılan kelimeleri oto düzeltir"</string> + <string name="auto_correction_summary" msgid="5625751551134658006">"Boşluk tuşu ve noktalama işaretleri yanlış yazılan kelimeleri otomatikman düzeltir"</string> <string name="auto_correction_threshold_mode_off" msgid="8470882665417944026">"Kapalı"</string> <string name="auto_correction_threshold_mode_modest" msgid="8788366690620799097">"Ölçülü"</string> <string name="auto_correction_threshold_mode_aggeressive" msgid="3524029103734923819">"Agresif"</string> @@ -106,7 +106,7 @@ <string name="voice_input_modes_main_keyboard" msgid="3360660341121083174">"Ana klavyede"</string> <string name="voice_input_modes_symbols_keyboard" msgid="7203213240786084067">"Simge klavyesinde"</string> <string name="voice_input_modes_off" msgid="3745699748218082014">"Kapalı"</string> - <string name="voice_input_modes_summary_main_keyboard" msgid="6586544292900314339">"Ana klavyede mikrfn"</string> + <string name="voice_input_modes_summary_main_keyboard" msgid="6586544292900314339">"Ana klavyedeki mikrofon"</string> <string name="voice_input_modes_summary_symbols_keyboard" msgid="5233725927281932391">"Simge klavysnd mikrf"</string> <string name="voice_input_modes_summary_off" msgid="63875609591897607">"Sesle grş devre dışı"</string> <string name="configure_input_method" msgid="373356270290742459">"Giriş yöntemlerini yapılandır"</string> diff --git a/java/res/xml-sw600dp/rowkeys_farsi1.xml b/java/res/xml-sw600dp/rowkeys_farsi1.xml index ab260a460..53208f286 100644 --- a/java/res/xml-sw600dp/rowkeys_farsi1.xml +++ b/java/res/xml-sw600dp/rowkeys_farsi1.xml @@ -45,12 +45,11 @@ <!-- U+0647: "ه" ARABIC LETTER HEH U+FEEB: "ﻫ" ARABIC LETTER HEH INITIAL FORM U+0647/U+200D: ARABIC LETTER HEH + ZERO WIDTH JOINER - U+06C0: "ۀ" ARABIC LETTER HEH WITH YEH ABOVE + U+0647/U+0654: ARABIC LETTER HEH + ARABIC HAMZA ABOVE U+0629: "ة" ARABIC LETTER TEH MARBUTA --> - <!-- TODO: DroidSansArabic lacks the glyph of U+06C0 ARABIC LETTER HEH WITH YEH ABOVE --> <Key latin:keyLabel="ه" - latin:moreKeys="ﻫ|ه‍,ۀ,ة,%" /> + latin:moreKeys="ﻫ|ه‍,هٔ,ة,%" /> <!-- U+062E: "خ" ARABIC LETTER KHAH --> <Key latin:keyLabel="خ" /> diff --git a/java/res/xml/key_styles_currency.xml b/java/res/xml/key_styles_currency.xml index d5c6a87b9..6dea16f89 100644 --- a/java/res/xml/key_styles_currency.xml +++ b/java/res/xml/key_styles_currency.xml @@ -105,6 +105,7 @@ latin:languageCode="fa" > <!-- U+FDFC: "﷼" RIAL SIGN + U+060B: "؋" AFGHANI SIGN U+00A3: "£" POUND SIGN U+20AC: "€" EURO SIGN U+00A2: "¢" CENT SIGN --> @@ -112,20 +113,20 @@ <key-style latin:styleName="currencyKeyStyle" latin:keyLabel="﷼" - latin:moreKeys="!text/more_keys_for_currency_general" /> + latin:moreKeys="!text/more_keys_for_currency_general,؋" /> <key-style latin:styleName="moreCurrency1KeyStyle" - latin:keyLabel="£" /> + latin:keyLabel="£" /> <key-style latin:styleName="moreCurrency2KeyStyle" - latin:keyLabel="€" /> + latin:keyLabel="€" /> <key-style latin:styleName="moreCurrency3KeyStyle" latin:keyLabel="$" - latin:moreKeys="¢" /> + latin:moreKeys="¢" /> <key-style latin:styleName="moreCurrency4KeyStyle" - latin:keyLabel="¢" /> + latin:keyLabel="¢" /> </case> <!-- United Kingdom --> <case diff --git a/java/res/xml/method.xml b/java/res/xml/method.xml index a0262846b..07bff098b 100644 --- a/java/res/xml/method.xml +++ b/java/res/xml/method.xml @@ -49,7 +49,7 @@ lt: Lithuanian/qwerty lv: Latvian/qwerty mk: Macedonian/south_slavic - nb: Norwaian Bokmål/nordic + nb: Norwegian Bokmål/nordic nl: Dutch/qwerty pl: Polish/qwerty pt_BR: Portuguese Brazil/qwerty diff --git a/java/res/xml/prefs.xml b/java/res/xml/prefs.xml index 3598a685e..137981949 100644 --- a/java/res/xml/prefs.xml +++ b/java/res/xml/prefs.xml @@ -122,7 +122,6 @@ android:defaultValue="true" /> <CheckBoxPreference android:key="next_word_prediction" - android:dependency="next_word_suggestion" android:title="@string/bigram_prediction" android:summary="@string/bigram_prediction_summary" android:persistent="true" diff --git a/java/res/xml/rowkeys_farsi1.xml b/java/res/xml/rowkeys_farsi1.xml index 15cb80182..81618af77 100644 --- a/java/res/xml/rowkeys_farsi1.xml +++ b/java/res/xml/rowkeys_farsi1.xml @@ -22,9 +22,11 @@ xmlns:latin="http://schemas.android.com/apk/res/com.android.inputmethod.latin" > <!-- U+0635: "ص" ARABIC LETTER SAD + U+0636: "ض" ARABIC LETTER DAD U+06F1: "۱" EXTENDED ARABIC-INDIC DIGIT ONE --> <Key latin:keyLabel="ص" + latin:moreKeys="ض,%" latin:keyHintLabel="1" latin:additionalMoreKeys="1,۱" /> <!-- U+0642: "ق" ARABIC LETTER QAF @@ -54,13 +56,12 @@ <!-- U+0647: "ه" ARABIC LETTER HEH U+FEEB: "ﻫ" ARABIC LETTER HEH INITIAL FORM U+0647/U+200D: ARABIC LETTER HEH + ZERO WIDTH JOINER - U+06C0: "ۀ" ARABIC LETTER HEH WITH YEH ABOVE + U+0647/U+0654: ARABIC LETTER HEH + ARABIC HAMZA ABOVE U+0629: "ة" ARABIC LETTER TEH MARBUTA U+06F6: "۶" EXTENDED ARABIC-INDIC DIGIT SIX --> - <!-- TODO: DroidSansArabic lacks the glyph of U+06C0 ARABIC LETTER HEH WITH YEH ABOVE --> <Key latin:keyLabel="ه" - latin:moreKeys="ﻫ|ه‍,ۀ,ة,%" + latin:moreKeys="ﻫ|ه‍,هٔ,ة,%" latin:keyHintLabel="6" latin:additionalMoreKeys="6,۶" /> <!-- U+062E: "خ" ARABIC LETTER KHAH diff --git a/java/res/xml/rowkeys_farsi3.xml b/java/res/xml/rowkeys_farsi3.xml index 8db56e340..44710e06a 100644 --- a/java/res/xml/rowkeys_farsi3.xml +++ b/java/res/xml/rowkeys_farsi3.xml @@ -26,20 +26,20 @@ <Key latin:keyLabel="ط" latin:moreKeys="ظ" /> - <!-- U+0698: "ژ" ARABIC LETTER JEH --> + <!-- U+0632: "ز" ARABIC LETTER ZAIN + U+0698: "ژ" ARABIC LETTER JEH --> <Key - latin:keyLabel="ژ" /> - <!-- U+0632: "ز" ARABIC LETTER ZAIN --> - <Key - latin:keyLabel="ز" /> + latin:keyLabel="ز" + latin:moreKeys="ژ" /> <!-- U+0631: "ر" ARABIC LETTER REH --> <Key latin:keyLabel="ر" /> - <!-- U+062F: "د" ARABIC LETTER DAL - U+0630: "ذ" ARABIC LETTER THAL --> + <!-- U+0630: "ذ" ARABIC LETTER THAL --> + <Key + latin:keyLabel="ذ" /> + <!-- U+062F: "د" ARABIC LETTER DAL --> <Key - latin:keyLabel="د" - latin:moreKeys="ذ" /> + latin:keyLabel="د" /> <!-- U+067E: "پ" ARABIC LETTER PEH --> <Key latin:keyLabel="پ" /> diff --git a/java/src/com/android/inputmethod/accessibility/AccessibilityEntityProvider.java b/java/src/com/android/inputmethod/accessibility/AccessibilityEntityProvider.java index ba08c593c..7d5d7142b 100644 --- a/java/src/com/android/inputmethod/accessibility/AccessibilityEntityProvider.java +++ b/java/src/com/android/inputmethod/accessibility/AccessibilityEntityProvider.java @@ -280,12 +280,6 @@ public class AccessibilityEntityProvider extends AccessibilityNodeProviderCompat return createAccessibilityNodeInfo(mAccessibilityFocusedView); } - @Override - public AccessibilityNodeInfoCompat accessibilityFocusSearch(int direction, int virtualViewId) { - // Focus search is not currently supported for IMEs. - return null; - } - /** * Sends an accessibility event for the given {@link Key}. * diff --git a/java/src/com/android/inputmethod/keyboard/MoreKeysKeyboardView.java b/java/src/com/android/inputmethod/keyboard/MoreKeysKeyboardView.java index b4fa86dd5..be7644fb5 100644 --- a/java/src/com/android/inputmethod/keyboard/MoreKeysKeyboardView.java +++ b/java/src/com/android/inputmethod/keyboard/MoreKeysKeyboardView.java @@ -159,7 +159,7 @@ public class MoreKeysKeyboardView extends KeyboardView implements MoreKeysPanel @Override public boolean dismissMoreKeysPanel() { - if (mIsDismissing) return false; + if (mIsDismissing || mController == null) return false; mIsDismissing = true; final boolean dismissed = mController.dismissMoreKeysPanel(); mIsDismissing = false; diff --git a/java/src/com/android/inputmethod/keyboard/internal/KeyboardTextsSet.java b/java/src/com/android/inputmethod/keyboard/internal/KeyboardTextsSet.java index 14d61e228..917e233a8 100644 --- a/java/src/com/android/inputmethod/keyboard/internal/KeyboardTextsSet.java +++ b/java/src/com/android/inputmethod/keyboard/internal/KeyboardTextsSet.java @@ -428,23 +428,23 @@ public final class KeyboardTextsSet { // U+201F: "‟" DOUBLE HIGH-REVERSED-9 QUOTATION MARK /* 54 */ "!fixedColumnOrder!3,\u2039|\u203A,\u2264|\u2265,\u00AB|\u00BB", /* 55 */ "!fixedColumnOrder!3,\u203A|\u2039,\u2265|\u2264,\u00BB|\u00AB", - // U+064F: "ُ" ARABIC DAMMA - // U+064C: "ٌ" ARABIC DAMMATAN - // U+0651: "ّ" ARABIC SHADDA + // U+0655: "ٕ" ARABIC HAMZA BELOW + // U+0654: "ٔ" ARABIC HAMZA ABOVE // U+0652: "ْ" ARABIC SUKUN - // U+0653: "ٓ" ARABIC MADDAH ABOVE // U+064D: "ٍ" ARABIC KASRATAN + // U+064C: "ٌ" ARABIC DAMMATAN // U+064B: "ً" ARABIC FATHATAN + // U+0651: "ّ" ARABIC SHADDA + // U+0656: "ٖ" ARABIC SUBSCRIPT ALEF + // U+0670: "ٰ" ARABIC LETTER SUPERSCRIPT ALEF + // U+0653: "ٓ" ARABIC MADDAH ABOVE // U+0650: "ِ" ARABIC KASRA + // U+064F: "ُ" ARABIC DAMMA // U+064E: "َ" ARABIC FATHA // U+0640: "ـ" ARABIC TATWEEL - // U+0656: "ٖ" ARABIC SUBSCRIPT ALEF - // U+0670: "ٰ" ARABIC LETTER SUPERSCRIPT ALEF - // U+0655: "ٕ" ARABIC HAMZA BELOW - // U+0654: "ٔ" ARABIC HAMZA ABOVE // In order to make Tatweel easily distinguishable from other punctuations, we use consecutive Tatweels only for its displayed label. - /* 56 */ "!fixedColumnOrder!5,\u064F,\u064C,\u0651,\u0652,\u0653,\u064D,\u064B,\u0650,\u064E,\u0640\u0640\u0640|\u0640,\u0656,\u0670,\u0655,\u0654", - /* 57 */ "\u064F", + /* 56 */ "!fixedColumnOrder!7,\u0655,\u0654,\u0652,\u064D,\u064C,\u064B,\u0651,\u0656,\u0670,\u0653,\u0650,\u064F,\u064E,\u0640\u0640\u0640|\u0640", + /* 57 */ "\u0651", // U+0661: "١" ARABIC-INDIC DIGIT ONE /* 58 */ "\u0661", // U+0662: "٢" ARABIC-INDIC DIGIT TWO @@ -1033,22 +1033,22 @@ public final class KeyboardTextsSet { // U+201F: "‟" DOUBLE HIGH-REVERSED-9 QUOTATION MARK /* 54 */ "!fixedColumnOrder!3,\u2039|\u203A,\u2264|\u2265,\u00AB|\u00BB", /* 55 */ "!fixedColumnOrder!3,\u203A|\u2039,\u2265|\u2264,\u00BB|\u00AB", - // U+0651: "ّ" ARABIC SHADDA - // U+064F: "ُ" ARABIC DAMMA - // U+0650: "ِ" ARABIC KASRA - // U+064E: "َ" ARABIC FATHA - // U+0653: "ٓ" ARABIC MADDAH ABOVE // U+0655: "ٕ" ARABIC HAMZA BELOW - // U+0654: "ٔ" ARABIC HAMZA ABOVE - // U+064D: "ٍ" ARABIC KASRATAN - // U+064B: "ً" ARABIC FATHATAN // U+0652: "ْ" ARABIC SUKUN - // U+0640: "ـ" ARABIC TATWEEL + // U+0651: "ّ" ARABIC SHADDA // U+064C: "ٌ" ARABIC DAMMATAN + // U+064D: "ٍ" ARABIC KASRATAN + // U+064B: "ً" ARABIC FATHATAN + // U+0654: "ٔ" ARABIC HAMZA ABOVE // U+0656: "ٖ" ARABIC SUBSCRIPT ALEF // U+0670: "ٰ" ARABIC LETTER SUPERSCRIPT ALEF + // U+0653: "ٓ" ARABIC MADDAH ABOVE + // U+064F: "ُ" ARABIC DAMMA + // U+0650: "ِ" ARABIC KASRA + // U+064E: "َ" ARABIC FATHA + // U+0640: "ـ" ARABIC TATWEEL // In order to make Tatweel easily distinguishable from other punctuations, we use consecutive Tatweels only for its displayed label. - /* 56 */ "!fixedColumnOrder!5,\u0651,\u064F,\u0650,\u064E,\u0653,\u0655,\u0654,\u064D,\u064B,\u0652,\u0640\u0640\u0640|\u0640,\u064C,\u0656,\u0670", + /* 56 */ "!fixedColumnOrder!7,\u0655,\u0652,\u0651,\u064C,\u064D,\u064B,\u0654,\u0656,\u0670,\u0653,\u064F,\u0650,\u064E,\u0640\u0640\u0640|\u0640", /* 57 */ "\u0653", // U+06F1: "۱" EXTENDED ARABIC-INDIC DIGIT ONE /* 58 */ "\u06F1", diff --git a/java/src/com/android/inputmethod/latin/LatinIME.java b/java/src/com/android/inputmethod/latin/LatinIME.java index 1f2982aed..97e898af9 100644 --- a/java/src/com/android/inputmethod/latin/LatinIME.java +++ b/java/src/com/android/inputmethod/latin/LatinIME.java @@ -2053,12 +2053,16 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen // showSuggestions will retrieve the word near the cursor, we don't want that here) showSuggestions(suggestedWords, ""); } else { - if (!isShowingPunctuationList()) setPunctuationSuggestions(); + clearSuggestions(); } } public void setPunctuationSuggestions() { - setSuggestions(mSettingsValues.mSuggestPuncList, false); + if (mSettingsValues.mBigramPredictionEnabled) { + clearSuggestions(); + } else { + setSuggestions(mSettingsValues.mSuggestPuncList, false); + } setAutoCorrectionIndicator(false); setSuggestionStripShown(isSuggestionsStripVisible()); } diff --git a/java/src/com/android/inputmethod/latin/Settings.java b/java/src/com/android/inputmethod/latin/Settings.java index c9ff0a5a8..152d66851 100644 --- a/java/src/com/android/inputmethod/latin/Settings.java +++ b/java/src/com/android/inputmethod/latin/Settings.java @@ -149,10 +149,13 @@ public class Settings extends InputMethodSettingsFragment generalSettings.removePreference(mVoicePreference); } + final PreferenceGroup advancedSettings = + (PreferenceGroup) findPreference(PREF_ADVANCED_SETTINGS); + // Remove those meaningless options for now. TODO: delete them for good + advancedSettings.removePreference(findPreference(PREF_BIGRAM_SUGGESTION)); + advancedSettings.removePreference(findPreference(PREF_KEY_ENABLE_SPAN_INSERT)); if (!VibratorUtils.getInstance(context).hasVibrator()) { generalSettings.removePreference(findPreference(PREF_VIBRATE_ON)); - final PreferenceGroup advancedSettings = - (PreferenceGroup) findPreference(PREF_ADVANCED_SETTINGS); if (null != advancedSettings) { // Theoretically advancedSettings cannot be null advancedSettings.removePreference(findPreference(PREF_VIBRATION_DURATION_SETTINGS)); } diff --git a/java/src/com/android/inputmethod/latin/SettingsValues.java b/java/src/com/android/inputmethod/latin/SettingsValues.java index 4aae6a85e..b07c3e59f 100644 --- a/java/src/com/android/inputmethod/latin/SettingsValues.java +++ b/java/src/com/android/inputmethod/latin/SettingsValues.java @@ -135,8 +135,8 @@ public class SettingsValues { && isBigramSuggestionEnabled(prefs, res, mAutoCorrectEnabled); mBigramPredictionEnabled = mBigramSuggestionEnabled && isBigramPredictionEnabled(prefs, res); - mEnableSuggestionSpanInsertion = - prefs.getBoolean(Settings.PREF_KEY_ENABLE_SPAN_INSERT, true); + // TODO: remove mEnableSuggestionSpanInsertion. It's always true. + mEnableSuggestionSpanInsertion = true; mVibrationDurationSettingsRawValue = prefs.getInt(Settings.PREF_VIBRATION_DURATION_SETTINGS, -1); mKeypressSoundVolumeRawValue = prefs.getFloat(Settings.PREF_KEYPRESS_SOUND_VOLUME, -1.0f); @@ -242,13 +242,8 @@ public class SettingsValues { private static boolean isBigramSuggestionEnabled(final SharedPreferences sp, final Resources resources, final boolean autoCorrectEnabled) { - final boolean showBigramSuggestionsOption = resources.getBoolean( - R.bool.config_enable_next_word_suggestions_option); - if (!showBigramSuggestionsOption) { - return autoCorrectEnabled; - } - return sp.getBoolean(Settings.PREF_BIGRAM_SUGGESTION, resources.getBoolean( - R.bool.config_default_next_word_suggestions)); + // TODO: remove this method. Bigram suggestion is always true. + return true; } private static boolean isBigramPredictionEnabled(final SharedPreferences sp, diff --git a/java/src/com/android/inputmethod/latin/suggestions/MoreSuggestionsView.java b/java/src/com/android/inputmethod/latin/suggestions/MoreSuggestionsView.java index 8a29dcc13..19287e3f3 100644 --- a/java/src/com/android/inputmethod/latin/suggestions/MoreSuggestionsView.java +++ b/java/src/com/android/inputmethod/latin/suggestions/MoreSuggestionsView.java @@ -167,7 +167,7 @@ public class MoreSuggestionsView extends KeyboardView implements MoreKeysPanel { @Override public boolean dismissMoreKeysPanel() { - if (mIsDismissing) return false; + if (mIsDismissing || mController == null) return false; mIsDismissing = true; final boolean dismissed = mController.dismissMoreKeysPanel(); mIsDismissing = false; diff --git a/java/src/com/android/inputmethod/latin/suggestions/SuggestionsView.java b/java/src/com/android/inputmethod/latin/suggestions/SuggestionsView.java index 3d593aaa7..e86390b11 100644 --- a/java/src/com/android/inputmethod/latin/suggestions/SuggestionsView.java +++ b/java/src/com/android/inputmethod/latin/suggestions/SuggestionsView.java @@ -670,7 +670,7 @@ public class SuggestionsView extends RelativeLayout implements OnClickListener, } public void setSuggestions(SuggestedWords suggestedWords) { - if (suggestedWords == null || suggestedWords.size() == 0) + if (suggestedWords == null) return; clear(); @@ -884,5 +884,6 @@ public class SuggestionsView extends RelativeLayout implements OnClickListener, super.onDetachedFromWindow(); mHandler.cancelAllMessages(); hidePreview(); + dismissMoreSuggestions(); } } |