From 2d171568613a674f848eb8f653def1a485231f13 Mon Sep 17 00:00:00 2001 From: Benoit Marty Date: Wed, 1 Dec 2021 22:16:28 +0100 Subject: [PATCH] Use `@id` and not `@+id` when referencing ids in layouts - accessibilityTraversal --- tools/check/forbidden_strings_in_layout.txt | 3 ++- vector/src/main/res/layout/fragment_room_list.xml | 4 ++-- vector/src/main/res/layout/motion_notifs_fab_menu_merge.xml | 6 +++--- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/tools/check/forbidden_strings_in_layout.txt b/tools/check/forbidden_strings_in_layout.txt index c611939b4a..4088cbea8d 100644 --- a/tools/check/forbidden_strings_in_layout.txt +++ b/tools/check/forbidden_strings_in_layout.txt @@ -27,4 +27,5 @@ android:textSize===9 ### Use `@id` and not `@+id` when referencing ids in layouts -Of="@\+id \ No newline at end of file +Of="@\+id +accessibilityTraversal(.*)="@\+id \ No newline at end of file diff --git a/vector/src/main/res/layout/fragment_room_list.xml b/vector/src/main/res/layout/fragment_room_list.xml index fac0c0f170..a8eec6ff3a 100644 --- a/vector/src/main/res/layout/fragment_room_list.xml +++ b/vector/src/main/res/layout/fragment_room_list.xml @@ -31,7 +31,7 @@ android:layout_gravity="bottom|end" android:layout_marginEnd="16dp" android:layout_marginBottom="16dp" - android:accessibilityTraversalBefore="@+id/roomListView" + android:accessibilityTraversalBefore="@id/roomListView" android:contentDescription="@string/a11y_create_direct_message" android:scaleType="center" android:src="@drawable/ic_fab_add_chat" @@ -47,7 +47,7 @@ android:layout_gravity="bottom|end" android:layout_marginEnd="16dp" android:layout_marginBottom="16dp" - android:accessibilityTraversalBefore="@+id/roomListView" + android:accessibilityTraversalBefore="@id/roomListView" android:contentDescription="@string/a11y_create_room" android:src="@drawable/ic_fab_add_room" android:visibility="gone" diff --git a/vector/src/main/res/layout/motion_notifs_fab_menu_merge.xml b/vector/src/main/res/layout/motion_notifs_fab_menu_merge.xml index 34e48f6e32..9723b5cadf 100644 --- a/vector/src/main/res/layout/motion_notifs_fab_menu_merge.xml +++ b/vector/src/main/res/layout/motion_notifs_fab_menu_merge.xml @@ -24,7 +24,7 @@ android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_gravity="bottom|end" - android:accessibilityTraversalBefore="@+id/roomListView" + android:accessibilityTraversalBefore="@id/roomListView" android:contentDescription="@string/a11y_create_room" android:src="@drawable/ic_fab_add_room" app:backgroundTint="#FFFFFF" @@ -48,7 +48,7 @@ android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_gravity="bottom|end" - android:accessibilityTraversalBefore="@+id/createRoomItemGroup" + android:accessibilityTraversalBefore="@id/createRoomItemGroup" android:contentDescription="@string/a11y_create_direct_message" android:src="@drawable/ic_fab_add_chat" app:backgroundTint="#FFFFFF" @@ -71,7 +71,7 @@ android:id="@+id/createRoomButton" android:layout_width="wrap_content" android:layout_height="wrap_content" - android:accessibilityTraversalBefore="@+id/createRoomItemChat" + android:accessibilityTraversalBefore="@id/createRoomItemChat" android:contentDescription="@string/a11y_create_menu_open" android:src="@drawable/ic_fab_add" app:maxImageSize="14dp" />