diff --git a/res/layout/suggestion_tile.xml b/res/layout/suggestion_tile.xml index fa3f3afe4de..850e55ae025 100644 --- a/res/layout/suggestion_tile.xml +++ b/res/layout/suggestion_tile.xml @@ -52,6 +52,7 @@ android:layout_alignParentEnd="true" android:layout_marginTop="8dp" android:layout_marginEnd="8dp" + android:contentDescription="@string/dlg_close" android:src="@drawable/ic_suggestion_close_button"/> diff --git a/res/layout/suggestion_tile_with_button.xml b/res/layout/suggestion_tile_with_button.xml index de3494afd0f..8fb8e84022e 100644 --- a/res/layout/suggestion_tile_with_button.xml +++ b/res/layout/suggestion_tile_with_button.xml @@ -52,6 +52,7 @@ android:layout_alignParentEnd="true" android:layout_marginTop="8dp" android:layout_marginEnd="8dp" + android:contentDescription="@string/dlg_close" android:src="@drawable/ic_suggestion_close_button"/> diff --git a/tests/robotests/src/com/android/settings/dashboard/suggestions/SuggestionAdapterTest.java b/tests/robotests/src/com/android/settings/dashboard/suggestions/SuggestionAdapterTest.java index bac02d37d86..4ff09c174c5 100644 --- a/tests/robotests/src/com/android/settings/dashboard/suggestions/SuggestionAdapterTest.java +++ b/tests/robotests/src/com/android/settings/dashboard/suggestions/SuggestionAdapterTest.java @@ -294,6 +294,19 @@ public class SuggestionAdapterTest { verify(drawable).setTint(colorAccent); } + @Test + public void onBindViewHolder_closeButtonShouldHaveContentDescription() + throws PendingIntent.CanceledException { + final List suggestions = makeSuggestions("pkg1"); + setupSuggestions(mActivity, suggestions); + + mSuggestionAdapter.onBindViewHolder(mSuggestionHolder, 0); + + assertThat( + mSuggestionHolder.itemView.findViewById(R.id.close_button).getContentDescription()) + .isNotNull(); + } + @Test public void setCardLayout_oneCard_shouldSetCardWidthToMatchParent() { final List suggestions = makeSuggestions("pkg1");