From 73bf75f65f5efe98663cfc99f117aac477d90f56 Mon Sep 17 00:00:00 2001 From: Paul Lanctot <planctot@nhm.org> Date: Fri, 2 Dec 2016 16:56:18 -0800 Subject: [PATCH] Accessible content labels for attachment icons Fixes #5908 Closes #5917 // FREEBIE --- res/layout/attachment_type_selector.xml | 11 +++++++++-- res/values/strings.xml | 9 +++++++++ 2 files changed, 18 insertions(+), 2 deletions(-) diff --git a/res/layout/attachment_type_selector.xml b/res/layout/attachment_type_selector.xml index 46d2526e21..e2a48e1ebb 100644 --- a/res/layout/attachment_type_selector.xml +++ b/res/layout/attachment_type_selector.xml @@ -34,6 +34,7 @@ android:src="@drawable/ic_image_white_36dp" android:scaleType="center" android:elevation="4dp" + android:contentDescription="@string/attachment_type_selector__image_description" app:circleColor="@color/purple_400"/> <TextView android:layout_marginTop="10dp" @@ -57,6 +58,7 @@ android:src="@drawable/ic_headset_white_36dp" android:scaleType="center" android:elevation="4dp" + android:contentDescription="@string/attachment_type_selector__audio_description" app:circleColor="@color/orange_400"/> <TextView android:layout_marginTop="10dp" @@ -80,7 +82,7 @@ android:src="@drawable/ic_local_movies_white_36dp" android:scaleType="center" android:elevation="4dp" - + android:contentDescription="@string/attachment_type_selector__video_description" app:circleColor="@color/red_400"/> <TextView android:layout_marginTop="10dp" @@ -104,6 +106,7 @@ android:src="@drawable/ic_person_white_36dp" android:scaleType="center" android:elevation="4dp" + android:contentDescription="@string/attachment_type_selector__contact_description" app:circleColor="@color/blue_400"/> <TextView android:layout_marginTop="10dp" @@ -138,6 +141,7 @@ android:src="@drawable/ic_camera_white_36dp" android:scaleType="center" android:elevation="4dp" + android:contentDescription="@string/attachment_type_selector__camera_description" app:circleColor="@color/green_400"/> <TextView android:layout_marginTop="10dp" @@ -163,6 +167,7 @@ android:src="@drawable/ic_location_on_white_36dp" android:scaleType="center" android:elevation="4dp" + android:contentDescription="@string/attachment_type_selector__location_description" app:circleColor="@color/blue_grey_400"/> <TextView android:layout_marginTop="10dp" @@ -187,13 +192,14 @@ android:src="@drawable/ic_gif_white_36dp" android:scaleType="center" android:elevation="4dp" + android:contentDescription="@string/attachment_type_selector__gif_description" app:circleColor="@color/cyan_400"/> <TextView android:layout_marginTop="10dp" android:layout_width="wrap_content" android:layout_height="wrap_content" style="@style/AttachmentTypeLabel" - android:text="GIF"/> + android:text="@string/attachment_type_selector__gif"/> </LinearLayout> @@ -210,6 +216,7 @@ android:src="@drawable/ic_keyboard_arrow_down_white_36dp" android:scaleType="center" android:elevation="4dp" + android:contentDescription="@string/attachment_type_selector__drawer_description" app:circleColor="@color/gray50"/> <TextView android:layout_marginTop="10dp" diff --git a/res/values/strings.xml b/res/values/strings.xml index 753b117233..78bb3500fd 100644 --- a/res/values/strings.xml +++ b/res/values/strings.xml @@ -632,11 +632,20 @@ <!-- attachment_type_selector --> <string name="attachment_type_selector__image">Image</string> + <string name="attachment_type_selector__image_description">Image</string> <string name="attachment_type_selector__audio">Audio</string> + <string name="attachment_type_selector__audio_description">Audio</string> <string name="attachment_type_selector__video">Video</string> + <string name="attachment_type_selector__video_description">Video</string> <string name="attachment_type_selector__contact">Contact</string> + <string name="attachment_type_selector__contact_description">Contact</string> <string name="attachment_type_selector__camera">Camera</string> + <string name="attachment_type_selector__camera_description">Camera</string> <string name="attachment_type_selector__location">Location</string> + <string name="attachment_type_selector__location_description">Location</string> + <string name="attachment_type_selector__gif">GIF</string> + <string name="attachment_type_selector__gif_description">Gif</string> + <string name="attachment_type_selector__drawer_description">Toggle attachment drawer</string> <!-- change_passphrase_activity --> <string name="change_passphrase_activity__old_passphrase">Old passphrase</string>