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

Commit 0f6f5b1f authored by Tadashi G. Takaoka's avatar Tadashi G. Takaoka Committed by Android (Google) Code Review
Browse files

Merge "Disable empty suggestion word on the suggestions strip"

parents 58c1fae5 ae42cd7e
Loading
Loading
Loading
Loading
+7 −0
Original line number Original line Diff line number Diff line
@@ -44,6 +44,7 @@ import android.view.ViewGroup;
import android.widget.LinearLayout;
import android.widget.LinearLayout;
import android.widget.TextView;
import android.widget.TextView;


import com.android.inputmethod.accessibility.AccessibilityUtils;
import com.android.inputmethod.latin.LatinImeLogger;
import com.android.inputmethod.latin.LatinImeLogger;
import com.android.inputmethod.latin.PunctuationSuggestions;
import com.android.inputmethod.latin.PunctuationSuggestions;
import com.android.inputmethod.latin.R;
import com.android.inputmethod.latin.R;
@@ -386,6 +387,12 @@ final class SuggestionStripLayoutHelper {
        final float scaleX = getTextScaleX(word, width, wordView.getPaint());
        final float scaleX = getTextScaleX(word, width, wordView.getPaint());
        wordView.setText(text); // TextView.setText() resets text scale x to 1.0.
        wordView.setText(text); // TextView.setText() resets text scale x to 1.0.
        wordView.setTextScaleX(Math.max(scaleX, MIN_TEXT_XSCALE));
        wordView.setTextScaleX(Math.max(scaleX, MIN_TEXT_XSCALE));
        // A <code>wordView</code> should be disabled when <code>word</code> is empty in order to
        // make it unclickable.
        // With accessibility touch exploration on, <code>wordView</code> should be enabled even
        // when it is empty to avoid announcing as "disabled".
        wordView.setEnabled(!TextUtils.isEmpty(word)
                || AccessibilityUtils.getInstance().isTouchExplorationEnabled());
        return wordView;
        return wordView;
    }
    }