diff options
Diffstat (limited to 'java/src/com/android/inputmethod')
5 files changed, 15 insertions, 7 deletions
diff --git a/java/src/com/android/inputmethod/accessibility/AccessibilityEntityProvider.java b/java/src/com/android/inputmethod/accessibility/AccessibilityEntityProvider.java index dd43166af..bb5890ad2 100644 --- a/java/src/com/android/inputmethod/accessibility/AccessibilityEntityProvider.java +++ b/java/src/com/android/inputmethod/accessibility/AccessibilityEntityProvider.java @@ -95,6 +95,7 @@ public class AccessibilityEntityProvider extends AccessibilityNodeProviderCompat event.setPackageName(mKeyboardView.getContext().getPackageName()); event.setClassName(key.getClass().getName()); event.getText().add(keyDescription); + event.setEnabled(true); final AccessibilityRecordCompat record = new AccessibilityRecordCompat(event); record.setSource(mKeyboardView, virtualViewId); @@ -171,6 +172,9 @@ public class AccessibilityEntityProvider extends AccessibilityNodeProviderCompat info.setSource(mKeyboardView, virtualViewId); info.setBoundsInScreen(boundsInScreen); info.setText(keyDescription); + info.setClickable(true); + info.setEnabled(true); + info.setLongClickable(true); } return info; diff --git a/java/src/com/android/inputmethod/compat/SuggestionSpanUtils.java b/java/src/com/android/inputmethod/compat/SuggestionSpanUtils.java index 5c351e41f..43c19d7eb 100644 --- a/java/src/com/android/inputmethod/compat/SuggestionSpanUtils.java +++ b/java/src/com/android/inputmethod/compat/SuggestionSpanUtils.java @@ -136,6 +136,8 @@ public class SuggestionSpanUtils { ? (OBJ_FLAG_EASY_CORRECT | OBJ_FLAG_MISSPELLED) : 0; + // TODO: We should avoid adding suggestion span candidates that came from the bigram + // prediction. final Object[] args = { context, null, suggestionsList.toArray(new String[suggestionsList.size()]), flag, (Class<?>) SuggestionSpanPickedNotificationReceiver.class }; diff --git a/java/src/com/android/inputmethod/latin/Settings.java b/java/src/com/android/inputmethod/latin/Settings.java index 7b98a7188..6bc049894 100644 --- a/java/src/com/android/inputmethod/latin/Settings.java +++ b/java/src/com/android/inputmethod/latin/Settings.java @@ -66,8 +66,8 @@ public class Settings extends InputMethodSettingsActivity public static final String PREF_KEY_PREVIEW_POPUP_DISMISS_DELAY = "pref_key_preview_popup_dismiss_delay"; public static final String PREF_KEY_USE_CONTACTS_DICT = "pref_key_use_contacts_dict"; - public static final String PREF_BIGRAM_SUGGESTION = "bigram_suggestion"; - public static final String PREF_BIGRAM_PREDICTIONS = "bigram_prediction"; + public static final String PREF_BIGRAM_SUGGESTION = "next_word_suggestion"; + public static final String PREF_BIGRAM_PREDICTIONS = "next_word_prediction"; public static final String PREF_KEY_ENABLE_SPAN_INSERT = "enable_span_insert"; public static final String PREF_VIBRATION_DURATION_SETTINGS = "pref_vibration_duration_settings"; @@ -167,7 +167,7 @@ public class Settings extends InputMethodSettingsActivity } final boolean showBigramSuggestionsOption = res.getBoolean( - R.bool.config_enable_bigram_suggestions_option); + R.bool.config_enable_next_word_suggestions_option); if (!showBigramSuggestionsOption) { textCorrectionGroup.removePreference(mBigramSuggestion); if (null != mBigramPrediction) { diff --git a/java/src/com/android/inputmethod/latin/SettingsValues.java b/java/src/com/android/inputmethod/latin/SettingsValues.java index 103678403..49ab7f9d7 100644 --- a/java/src/com/android/inputmethod/latin/SettingsValues.java +++ b/java/src/com/android/inputmethod/latin/SettingsValues.java @@ -236,18 +236,18 @@ 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_bigram_suggestions_option); + 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_bigram_suggestions)); + R.bool.config_default_next_word_suggestions)); } private static boolean isBigramPredictionEnabled(final SharedPreferences sp, final Resources resources) { return sp.getBoolean(Settings.PREF_BIGRAM_PREDICTIONS, resources.getBoolean( - R.bool.config_default_bigram_prediction)); + R.bool.config_default_next_word_prediction)); } private static double getAutoCorrectionThreshold(final Resources resources, diff --git a/java/src/com/android/inputmethod/latin/Suggest.java b/java/src/com/android/inputmethod/latin/Suggest.java index b31f3019c..0fcac58a6 100644 --- a/java/src/com/android/inputmethod/latin/Suggest.java +++ b/java/src/com/android/inputmethod/latin/Suggest.java @@ -261,7 +261,9 @@ public class Suggest implements Dictionary.WordCallback { SuggestedWordInfo.removeDups(mSuggestions); return new SuggestedWords(mSuggestions, - false /* typedWordValid */, + // TODO: Just assuming the suggestions that came from the bigram prediction are + // valid now. Need to assign a correct value for typedWordValid. + true /* typedWordValid */, false /* hasAutoCorrectionCandidate */, false /* allowsToBeAutoCorrected */, false /* isPunctuationSuggestions */, |