From 06d1cdd5dc73ef118e2a2853fc75dc911202f373 Mon Sep 17 00:00:00 2001 From: "Tadashi G. Takaoka" Date: Tue, 13 May 2014 15:53:01 +0900 Subject: [PATCH] Add content description to the voice key Bug: 14849593 Change-Id: I1664b6a4ef54b78a09df65adbffff7861b54c4a9 --- java/res/layout/suggestions_strip.xml | 1 + .../latin/suggestions/SuggestionStripLayoutHelper.java | 5 ++++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/java/res/layout/suggestions_strip.xml b/java/res/layout/suggestions_strip.xml index 36898c890..3d2f07f7b 100644 --- a/java/res/layout/suggestions_strip.xml +++ b/java/res/layout/suggestions_strip.xml @@ -71,5 +71,6 @@ android:layout_alignParentEnd="true" android:layout_alignParentRight="true" android:layout_centerVertical="true" + android:contentDescription="@string/spoken_description_mic" style="?attr/suggestionWordStyle" /> diff --git a/java/src/com/android/inputmethod/latin/suggestions/SuggestionStripLayoutHelper.java b/java/src/com/android/inputmethod/latin/suggestions/SuggestionStripLayoutHelper.java index 8bfa63c3c..810bda758 100644 --- a/java/src/com/android/inputmethod/latin/suggestions/SuggestionStripLayoutHelper.java +++ b/java/src/com/android/inputmethod/latin/suggestions/SuggestionStripLayoutHelper.java @@ -381,6 +381,7 @@ final class SuggestionStripLayoutHelper { } // Disable this suggestion if the suggestion is null or empty. + // TODO: Fix disabled {@link TextView}'s content description. wordView.setEnabled(!TextUtils.isEmpty(word)); final CharSequence text = getEllipsizedText(word, width, wordView.getPaint()); final float scaleX = getTextScaleX(word, width, wordView.getPaint()); @@ -424,7 +425,9 @@ final class SuggestionStripLayoutHelper { final int countInStrip) { // Clear all suggestions first for (int positionInStrip = 0; positionInStrip < countInStrip; ++positionInStrip) { - mWordViews.get(positionInStrip).setText(null); + final TextView wordView = mWordViews.get(positionInStrip); + wordView.setText(null); + wordView.setTag(null); // Make this inactive for touches in {@link #layoutWord(int,int)}. if (SuggestionStripView.DBG) { mDebugInfoViews.get(positionInStrip).setText(null);