Fix a few accessibility issues

This commit is contained in:
Benoit Marty 2019-09-23 16:17:28 +02:00 committed by Benoit Marty
parent 3fcfa33364
commit 620ba279d8
9 changed files with 33 additions and 7 deletions

View File

@ -10,7 +10,7 @@ Improvements:
- Remove any notification of a redacted event (#563)
Other changes:
-
- Fix a few accessibility issues
Bugfix:
- Fix characters erased from the Search field when the result are coming (#545)

View File

@ -68,6 +68,8 @@ class ImageContentRenderer @Inject constructor(private val activeSessionHolder:
val (width, height) = processSize(data, mode)
imageView.layoutParams.height = height
imageView.layoutParams.width = width
// a11y
imageView.contentDescription = data.filename
createGlideRequest(data, mode, imageView, width, height)
.dontAnimate()
@ -80,6 +82,9 @@ class ImageContentRenderer @Inject constructor(private val activeSessionHolder:
fun renderFitTarget(data: Data, mode: Mode, imageView: ImageView, callback: ((Boolean) -> Unit)? = null) {
val (width, height) = processSize(data, mode)
// a11y
imageView.contentDescription = data.filename
createGlideRequest(data, mode, imageView, width, height)
.listener(object : RequestListener<Drawable> {
override fun onLoadFailed(e: GlideException?,
@ -127,6 +132,9 @@ class ImageContentRenderer @Inject constructor(private val activeSessionHolder:
}
fun render(data: Data, imageView: BigImageView) {
// a11y
imageView.contentDescription = data.filename
val (width, height) = processSize(data, Mode.THUMBNAIL)
val contentUrlResolver = activeSessionHolder.getActiveSession().contentUrlResolver()
val fullSize = contentUrlResolver.resolveFullSize(data.url)

View File

@ -25,6 +25,7 @@
android:id="@+id/groupToolbarAvatarImageView"
android:layout_width="32dp"
android:layout_height="32dp"
android:contentDescription="@string/a11y_open_drawer"
tools:src="@tools:sample/avatars" />
<TextView

View File

@ -17,6 +17,7 @@
android:id="@+id/createChatFabMenu"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:accessibilityTraversalBefore="@+id/roomListEpoxyRecyclerView"
android:visibility="gone"
app:layoutDescription="@xml/motion_scene_fab_menu"
tools:showPaths="true"
@ -30,6 +31,8 @@
android:layout_marginEnd="16dp"
android:layout_marginRight="16dp"
android:layout_marginBottom="16dp"
android:accessibilityTraversalBefore="@+id/roomListEpoxyRecyclerView"
android:contentDescription="@string/a11y_create_direct_message"
android:scaleType="center"
android:src="@drawable/ic_fab_add_chat"
android:visibility="gone"
@ -45,6 +48,8 @@
android:layout_marginEnd="16dp"
android:layout_marginRight="16dp"
android:layout_marginBottom="16dp"
android:accessibilityTraversalBefore="@+id/roomListEpoxyRecyclerView"
android:contentDescription="@string/a11y_create_room"
android:src="@drawable/ic_fab_add_room"
android:visibility="gone"
app:maxImageSize="32dp"

View File

@ -71,6 +71,7 @@
android:layout_width="22dp"
android:layout_height="22dp"
android:background="?android:attr/selectableItemBackground"
android:contentDescription="@string/action_close"
android:src="@drawable/ic_close_round"
android:tint="@color/riotx_notice"
tools:ignore="MissingConstraints" />
@ -88,6 +89,7 @@
android:layout_width="0dp"
android:layout_height="0dp"
android:background="?android:attr/selectableItemBackground"
android:contentDescription="@string/send_attachment"
android:src="@drawable/ic_attachment"
android:tint="?attr/colorAccent"
tools:ignore="MissingConstraints" />
@ -107,6 +109,7 @@
android:layout_width="0dp"
android:layout_height="0dp"
android:background="?android:attr/selectableItemBackground"
android:contentDescription="@string/send"
android:src="@drawable/ic_send"
android:tint="?attr/colorAccent"
tools:ignore="MissingConstraints" />

View File

@ -21,6 +21,7 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="bottom|end"
android:contentDescription="@string/a11y_create_room"
android:src="@drawable/ic_fab_add_room"
app:backgroundTint="#FFFFFF"
app:fabCustomSize="48dp"
@ -43,6 +44,7 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="bottom|end"
android:contentDescription="@string/a11y_create_direct_message"
android:src="@drawable/ic_fab_add_chat"
app:backgroundTint="#FFFFFF"
app:fabCustomSize="48dp"
@ -64,6 +66,7 @@
android:id="@+id/createRoomButton"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:contentDescription="@string/a11y_create_menu"
android:src="@drawable/ic_fab_add"
app:maxImageSize="14dp" />

View File

@ -106,6 +106,7 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="20dp"
android:contentDescription="@string/a11y_close_keys_backup_banner"
android:src="@drawable/ic_small_close"
app:layout_constraintEnd_toEndOf="@id/view_keys_backup_banner_close"
app:layout_constraintStart_toStartOf="@id/view_keys_backup_banner_close"

View File

@ -3,23 +3,20 @@
<item
android:id="@+id/bottom_action_home"
android:contentDescription="@string/bottom_action_home"
android:enabled="true"
android:icon="@drawable/ic_home_bottom_catchup"
android:title="" />
android:title="@string/bottom_action_home" />
<item
android:id="@+id/bottom_action_people"
android:contentDescription="@string/bottom_action_people_x"
android:enabled="true"
android:icon="@drawable/ic_home_bottom_chat"
android:title="" />
android:title="@string/bottom_action_people_x" />
<item
android:id="@+id/bottom_action_rooms"
android:contentDescription="@string/bottom_action_rooms"
android:enabled="true"
android:icon="@drawable/ic_home_bottom_group"
android:title="" />
android:title="@string/bottom_action_rooms" />
</menu>

View File

@ -13,4 +13,12 @@
<string name="error_network_timeout">Looks like the server is taking to long to respond, this can be caused by either poor connectivity or an error with our servers. Please try again in a while.</string>
<string name="send_attachment">Send attachment</string>
<string name="a11y_open_drawer">Open the navigation drawer</string>
<string name="a11y_create_menu">Create…</string>
<string name="a11y_create_direct_message">Create a new direct conversation</string>
<string name="a11y_create_room">Create a new room</string>
<string name="a11y_close_keys_backup_banner">Close keys backup banner</string>
</resources>