Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit c6e4acb1 authored by Tadashi G. Takaoka's avatar Tadashi G. Takaoka Committed by Android Git Automerger
Browse files

am 6fb586a5: Fix missing prediction words on contextual strip

* commit '6fb586a5':
  Fix missing prediction words on contextual strip
parents 7ac63288 6fb586a5
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -23,7 +23,7 @@
    <string name="prefs_debug_mode">Debug Mode</string>
    <string name="prefs_force_non_distinct_multitouch">Force non-distinct multitouch</string>
    <string name="prefs_force_physical_keyboard_special_key">Force physical keyboard special key</string>
    <string name="prefs_show_ui_to_accept_typed_word">Show UI to accept typed word</string>
    <string name="prefs_should_show_lxx_suggestion_ui">Show LXX suggestion UI</string>
    <!-- Option to enable sliding key input indicator. The user can see a rubber band-like effect during sliding key input. [CHAR LIMIT=30]-->
    <string name="sliding_key_input_preview">Show slide indicator</string>
    <!-- Option summary to enable sliding key input indicator. The user can see a rubber band-like effect during sliding key input. [CHAR LIMIT=66]-->
+2 −2
Original line number Diff line number Diff line
@@ -36,8 +36,8 @@
        android:defaultValue="false"
        android:persistent="true" />
    <CheckBoxPreference
        android:key="pref_show_ui_to_accept_typed_word"
        android:title="@string/prefs_show_ui_to_accept_typed_word"
        android:key="pref_should_show_lxx_suggestion_ui"
        android:title="@string/prefs_should_show_lxx_suggestion_ui"
        android:defaultValue="true"
        android:persistent="true" />
    <CheckBoxPreference
+13 −0
Original line number Diff line number Diff line
@@ -112,6 +112,19 @@ public class SuggestedWords {
        return mSuggestedWordInfoList.size();
    }

    /**
     * Get suggested word to show as suggestions to UI.
     *
     * @param shouldShowLxxSuggestionUi true if showing suggestion UI introduced in LXX and later.
     * @return the count of suggested word to show as suggestions to UI.
     */
    public int getWordCountToShow(final boolean shouldShowLxxSuggestionUi) {
        if (isPrediction() || !shouldShowLxxSuggestionUi) {
            return size();
        }
        return size() - /* typed word */ 1;
    }

    /**
     * Get suggested word at <code>index</code>.
     * @param index The index of the suggested word.
+2 −3
Original line number Diff line number Diff line
@@ -53,7 +53,6 @@ import com.android.inputmethod.latin.SuggestedWords;
import com.android.inputmethod.latin.SuggestedWords.SuggestedWordInfo;
import com.android.inputmethod.latin.WordComposer;
import com.android.inputmethod.latin.define.DebugFlags;
import com.android.inputmethod.latin.define.ProductionFlags;
import com.android.inputmethod.latin.settings.SettingsValues;
import com.android.inputmethod.latin.settings.SettingsValuesForSuggestion;
import com.android.inputmethod.latin.settings.SpacingAndPunctuations;
@@ -169,7 +168,7 @@ public final class InputLogic {
            mInputLogicHandler.reset();
        }

        if (settingsValues.mShouldShowUiToAcceptTypedWord) {
        if (settingsValues.mShouldShowLxxSuggestionUi) {
            mConnection.requestCursorUpdates(true /* enableMonitor */,
                    true /* requestImmediateCallback */);
        }
@@ -2352,7 +2351,7 @@ public final class InputLogic {
            // We cannot help in this case because we are heavily relying on this new API.
            return false;
        }
        if (!settingsValues.mShouldShowUiToAcceptTypedWord) {
        if (!settingsValues.mShouldShowLxxSuggestionUi) {
            return false;
        }
        if (TextUtils.isEmpty(lastComposedWord.mTypedWord)) {
+2 −2
Original line number Diff line number Diff line
@@ -21,8 +21,8 @@ public final class DebugSettings {
    public static final String PREF_FORCE_NON_DISTINCT_MULTITOUCH = "force_non_distinct_multitouch";
    public static final String PREF_FORCE_PHYSICAL_KEYBOARD_SPECIAL_KEY =
            "force_physical_keyboard_special_key";
    public static final String PREF_SHOW_UI_TO_ACCEPT_TYPED_WORD =
            "pref_show_ui_to_accept_typed_word";
    public static final String PREF_SHOULD_SHOW_LXX_SUGGESTION_UI =
            "pref_should_show_lxx_suggestion_ui";
    public static final String PREF_HAS_CUSTOM_KEY_PREVIEW_ANIMATION_PARAMS =
            "pref_has_custom_key_preview_animation_params";
    public static final String PREF_KEY_PREVIEW_SHOW_UP_START_X_SCALE =
Loading