Add content description to the voice key

Bug: 14849593
Change-Id: I1664b6a4ef54b78a09df65adbffff7861b54c4a9
main
Tadashi G. Takaoka 2014-05-13 15:53:01 +09:00
parent dcd74ba929
commit 06d1cdd5dc
2 changed files with 5 additions and 1 deletions

View File

@ -71,5 +71,6 @@
android:layout_alignParentEnd="true" android:layout_alignParentEnd="true"
android:layout_alignParentRight="true" android:layout_alignParentRight="true"
android:layout_centerVertical="true" android:layout_centerVertical="true"
android:contentDescription="@string/spoken_description_mic"
style="?attr/suggestionWordStyle" /> style="?attr/suggestionWordStyle" />
</merge> </merge>

View File

@ -381,6 +381,7 @@ final class SuggestionStripLayoutHelper {
} }
// Disable this suggestion if the suggestion is null or empty. // Disable this suggestion if the suggestion is null or empty.
// TODO: Fix disabled {@link TextView}'s content description.
wordView.setEnabled(!TextUtils.isEmpty(word)); wordView.setEnabled(!TextUtils.isEmpty(word));
final CharSequence text = getEllipsizedText(word, width, wordView.getPaint()); final CharSequence text = getEllipsizedText(word, width, wordView.getPaint());
final float scaleX = getTextScaleX(word, width, wordView.getPaint()); final float scaleX = getTextScaleX(word, width, wordView.getPaint());
@ -424,7 +425,9 @@ final class SuggestionStripLayoutHelper {
final int countInStrip) { final int countInStrip) {
// Clear all suggestions first // Clear all suggestions first
for (int positionInStrip = 0; positionInStrip < countInStrip; ++positionInStrip) { 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)}. // Make this inactive for touches in {@link #layoutWord(int,int)}.
if (SuggestionStripView.DBG) { if (SuggestionStripView.DBG) {
mDebugInfoViews.get(positionInStrip).setText(null); mDebugInfoViews.get(positionInStrip).setText(null);