Fix a few accessibility issues - home menu (best compromise)

This commit is contained in:
Benoit Marty 2019-09-23 17:48:13 +02:00
parent 620ba279d8
commit c1f2e9f171
4 changed files with 24 additions and 4 deletions

View file

@ -63,6 +63,18 @@ class FabMenuView @JvmOverloads constructor(context: Context, attrs: AttributeSe
}
}
override fun transitionToEnd() {
super.transitionToEnd()
createRoomButton.contentDescription = context.getString(R.string.a11y_create_menu_close)
}
override fun transitionToStart() {
super.transitionToStart()
createRoomButton.contentDescription = context.getString(R.string.a11y_create_menu_open)
}
fun show() {
isVisible = true
createRoomButton.show()

View file

@ -17,7 +17,6 @@
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"

View file

@ -13,7 +13,10 @@
android:id="@+id/createRoomTouchGuard"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="?riotx_touch_guard_bg" />
android:background="?riotx_touch_guard_bg"
android:clickable="true"
android:contentDescription="@string/a11y_create_menu_close"
android:focusable="true" />
<!-- Sub menu item 2 -->
<com.google.android.material.floatingactionbutton.FloatingActionButton
@ -21,6 +24,7 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="bottom|end"
android:accessibilityTraversalBefore="@+id/roomListEpoxyRecyclerView"
android:contentDescription="@string/a11y_create_room"
android:src="@drawable/ic_fab_add_room"
app:backgroundTint="#FFFFFF"
@ -36,6 +40,7 @@
android:layout_marginEnd="8dp"
android:layout_marginRight="8dp"
android:ellipsize="end"
android:importantForAccessibility="no"
android:text="@string/fab_menu_create_room" />
<!-- Sub menu item 1 -->
@ -44,6 +49,7 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="bottom|end"
android:accessibilityTraversalBefore="@+id/createRoomItemGroup"
android:contentDescription="@string/a11y_create_direct_message"
android:src="@drawable/ic_fab_add_chat"
app:backgroundTint="#FFFFFF"
@ -59,6 +65,7 @@
android:layout_marginEnd="8dp"
android:layout_marginRight="8dp"
android:ellipsize="end"
android:importantForAccessibility="no"
android:text="@string/fab_menu_create_chat" />
<!-- Menu -->
@ -66,7 +73,8 @@
android:id="@+id/createRoomButton"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:contentDescription="@string/a11y_create_menu"
android:accessibilityTraversalBefore="@+id/createRoomItemChat"
android:contentDescription="@string/a11y_create_menu_open"
android:src="@drawable/ic_fab_add"
app:maxImageSize="14dp" />

View file

@ -16,7 +16,8 @@
<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_menu_open">Open the create room menu</string>
<string name="a11y_create_menu_close">Close the create room menu…</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>