aboutsummaryrefslogtreecommitdiffstats
path: root/java/src
diff options
context:
space:
mode:
authorTadashi G. Takaoka <takaoka@google.com>2014-06-20 02:23:18 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2014-06-20 02:04:45 +0000
commit0f6f5b1fdc485a446c620b356d27ed3d4ade66be (patch)
treea96411833757487e64d2b4d1be918a4e1afe04b8 /java/src
parent58c1fae507c0b36ee2ff587226f81e19954bf1cb (diff)
parentae42cd7e43488aead5310c5fcb7467b8ce9c2dd6 (diff)
downloadlatinime-0f6f5b1fdc485a446c620b356d27ed3d4ade66be.tar.gz
latinime-0f6f5b1fdc485a446c620b356d27ed3d4ade66be.tar.xz
latinime-0f6f5b1fdc485a446c620b356d27ed3d4ade66be.zip
Merge "Disable empty suggestion word on the suggestions strip"
Diffstat (limited to 'java/src')
-rw-r--r--java/src/com/android/inputmethod/latin/suggestions/SuggestionStripLayoutHelper.java7
1 files changed, 7 insertions, 0 deletions
diff --git a/java/src/com/android/inputmethod/latin/suggestions/SuggestionStripLayoutHelper.java b/java/src/com/android/inputmethod/latin/suggestions/SuggestionStripLayoutHelper.java
index 19b48f081..46f5cdee0 100644
--- a/java/src/com/android/inputmethod/latin/suggestions/SuggestionStripLayoutHelper.java
+++ b/java/src/com/android/inputmethod/latin/suggestions/SuggestionStripLayoutHelper.java
@@ -44,6 +44,7 @@ import android.view.ViewGroup;
import android.widget.LinearLayout;
import android.widget.TextView;
+import com.android.inputmethod.accessibility.AccessibilityUtils;
import com.android.inputmethod.latin.LatinImeLogger;
import com.android.inputmethod.latin.PunctuationSuggestions;
import com.android.inputmethod.latin.R;
@@ -386,6 +387,12 @@ final class SuggestionStripLayoutHelper {
final float scaleX = getTextScaleX(word, width, wordView.getPaint());
wordView.setText(text); // TextView.setText() resets text scale x to 1.0.
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;
}