From 9e86b35f8cbe923332a79e13c328876d6a43a24e Mon Sep 17 00:00:00 2001 From: Benoit Marty Date: Fri, 12 Feb 2021 15:04:03 +0100 Subject: [PATCH] Fix some lint issue about accessibility --- .../java/im/vector/app/core/dialogs/ExportKeysDialog.kt | 2 +- vector/src/main/res/layout/activity_bug_report.xml | 1 + vector/src/main/res/layout/activity_call.xml | 6 +++++- .../src/main/res/layout/bottom_sheet_call_dial_pad.xml | 9 ++++++--- .../main/res/layout/bottom_sheet_logout_and_backup.xml | 1 + .../src/main/res/layout/bottom_sheet_matrix_to_card.xml | 1 + .../res/layout/bottom_sheet_room_widget_permission.xml | 1 + .../main/res/layout/bottom_sheet_save_recovery_key.xml | 2 ++ .../main/res/layout/custom_action_item_layout_badge.xml | 2 ++ vector/src/main/res/layout/dialog_change_password.xml | 1 + vector/src/main/res/layout/dialog_export_e2e_keys.xml | 1 + vector/src/main/res/layout/dialog_import_e2e_keys.xml | 1 + vector/src/main/res/layout/dialog_prompt_password.xml | 2 +- .../src/main/res/layout/fragment_attachments_preview.xml | 1 + .../layout/fragment_bootstrap_enter_account_password.xml | 1 + .../res/layout/fragment_bootstrap_migrate_backup.xml | 1 + vector/src/main/res/layout/fragment_contacts_book.xml | 1 + .../fragment_create_direct_room_directory_users.xml | 1 + vector/src/main/res/layout/fragment_create_room.xml | 1 + vector/src/main/res/layout/fragment_home_drawer.xml | 2 ++ .../res/layout/fragment_keys_backup_restore_from_key.xml | 2 ++ .../fragment_keys_backup_restore_from_passphrase.xml | 2 ++ vector/src/main/res/values/strings.xml | 4 ++++ 23 files changed, 40 insertions(+), 6 deletions(-) diff --git a/vector/src/main/java/im/vector/app/core/dialogs/ExportKeysDialog.kt b/vector/src/main/java/im/vector/app/core/dialogs/ExportKeysDialog.kt index e137eb1b70..6e7d2a3f4d 100644 --- a/vector/src/main/java/im/vector/app/core/dialogs/ExportKeysDialog.kt +++ b/vector/src/main/java/im/vector/app/core/dialogs/ExportKeysDialog.kt @@ -61,7 +61,7 @@ class ExportKeysDialog { passwordVisible = !passwordVisible views.exportDialogEt.showPassword(passwordVisible) views.exportDialogEtConfirm.showPassword(passwordVisible) - views.exportDialogShowPassword.setImageResource(if (passwordVisible) R.drawable.ic_eye_closed else R.drawable.ic_eye) + views.exportDialogShowPassword.setImageResource(if (passwordVisible) R.drawable.ic_eye_closed else R.drawable.ic_eye) // TODO Content description } val exportDialog = builder.show() diff --git a/vector/src/main/res/layout/activity_bug_report.xml b/vector/src/main/res/layout/activity_bug_report.xml index 34169f44f8..2347d84ee3 100644 --- a/vector/src/main/res/layout/activity_bug_report.xml +++ b/vector/src/main/res/layout/activity_bug_report.xml @@ -150,6 +150,7 @@ android:layout_gravity="center_horizontal" android:layout_marginTop="10dp" android:adjustViewBounds="true" + android:contentDescription="@string/a11y_screenshot" android:maxWidth="260dp" android:scaleType="fitCenter" tools:src="@tools:sample/backgrounds/scenic" /> diff --git a/vector/src/main/res/layout/activity_call.xml b/vector/src/main/res/layout/activity_call.xml index ff33c5f17c..7ea632eefb 100644 --- a/vector/src/main/res/layout/activity_call.xml +++ b/vector/src/main/res/layout/activity_call.xml @@ -16,6 +16,7 @@ android:id="@+id/bgCallView" android:layout_width="match_parent" android:layout_height="match_parent" + android:importantForAccessibility="no" android:scaleType="centerCrop" tools:src="@tools:sample/avatars" /> @@ -53,6 +54,7 @@ android:layout_width="match_parent" android:layout_height="match_parent" android:foreground="?attr/selectableItemBackground" + android:importantForAccessibility="no" android:scaleType="centerCrop" tools:src="@tools:sample/avatars" /> @@ -61,6 +63,7 @@ android:layout_width="20dp" android:layout_height="20dp" android:layout_gravity="center" + android:importantForAccessibility="no" android:src="@drawable/ic_call_small_pause" /> @@ -70,6 +73,7 @@ android:layout_width="80dp" android:layout_height="80dp" android:contentDescription="@string/avatar" + android:importantForAccessibility="no" android:scaleType="centerCrop" app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintEnd_toEndOf="parent" @@ -81,13 +85,13 @@ android:id="@+id/smallIsHeldIcon" android:layout_width="20dp" android:layout_height="20dp" + android:importantForAccessibility="no" android:src="@drawable/ic_call_small_pause" app:layout_constraintBottom_toBottomOf="@id/otherMemberAvatar" app:layout_constraintEnd_toEndOf="@id/otherMemberAvatar" app:layout_constraintStart_toStartOf="@id/otherMemberAvatar" app:layout_constraintTop_toTopOf="@id/otherMemberAvatar" /> - + android:scaleType="center" + android:src="@drawable/ic_cross" + app:tint="?riotx_text_primary" + tools:ignore="MissingPrefix" /> diff --git a/vector/src/main/res/layout/bottom_sheet_logout_and_backup.xml b/vector/src/main/res/layout/bottom_sheet_logout_and_backup.xml index 97168b4bdb..069f52df31 100644 --- a/vector/src/main/res/layout/bottom_sheet_logout_and_backup.xml +++ b/vector/src/main/res/layout/bottom_sheet_logout_and_backup.xml @@ -47,6 +47,7 @@ android:id="@+id/backupCompleteImage" android:layout_width="20dp" android:layout_height="20dp" + android:importantForAccessibility="no" android:visibility="gone" app:srcCompat="@drawable/unit_test_ok" tools:visibility="visible" /> diff --git a/vector/src/main/res/layout/bottom_sheet_matrix_to_card.xml b/vector/src/main/res/layout/bottom_sheet_matrix_to_card.xml index d051bd7c98..37f9633728 100644 --- a/vector/src/main/res/layout/bottom_sheet_matrix_to_card.xml +++ b/vector/src/main/res/layout/bottom_sheet_matrix_to_card.xml @@ -22,6 +22,7 @@ android:layout_width="60dp" android:layout_height="60dp" android:layout_marginTop="@dimen/layout_vertical_margin_big" + android:contentDescription="@string/avatar" android:elevation="4dp" android:transitionName="profile" app:layout_constraintEnd_toEndOf="parent" diff --git a/vector/src/main/res/layout/bottom_sheet_room_widget_permission.xml b/vector/src/main/res/layout/bottom_sheet_room_widget_permission.xml index 56459e90d6..2f8d890131 100644 --- a/vector/src/main/res/layout/bottom_sheet_room_widget_permission.xml +++ b/vector/src/main/res/layout/bottom_sheet_room_widget_permission.xml @@ -45,6 +45,7 @@ android:layout_width="40dp" android:layout_height="40dp" android:layout_gravity="center" + android:contentDescription="@string/avatar" tools:src="@tools:sample/avatars" /> @@ -77,6 +78,7 @@ android:layout_height="24dp" android:layout_gravity="center_vertical" android:layout_marginEnd="16dp" + android:importantForAccessibility="no" android:src="@drawable/ic_material_save" app:tint="?colorAccent" tools:ignore="MissingPrefix" /> diff --git a/vector/src/main/res/layout/custom_action_item_layout_badge.xml b/vector/src/main/res/layout/custom_action_item_layout_badge.xml index 4d1d398559..b9b3e7fef2 100644 --- a/vector/src/main/res/layout/custom_action_item_layout_badge.xml +++ b/vector/src/main/res/layout/custom_action_item_layout_badge.xml @@ -6,12 +6,14 @@ android:layout_width="wrap_content" android:layout_height="wrap_content" android:clipToPadding="false" + android:contentDescription="@string/a11y_open_widget" android:focusable="true"> diff --git a/vector/src/main/res/layout/fragment_attachments_preview.xml b/vector/src/main/res/layout/fragment_attachments_preview.xml index ec99cce9b3..f40cc51e9d 100644 --- a/vector/src/main/res/layout/fragment_attachments_preview.xml +++ b/vector/src/main/res/layout/fragment_attachments_preview.xml @@ -67,6 +67,7 @@ android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_margin="16dp" + android:contentDescription="@string/send" android:src="@drawable/ic_send" app:layout_constraintBottom_toTopOf="@id/attachmentPreviewerBottomContainer" app:layout_constraintEnd_toEndOf="parent" diff --git a/vector/src/main/res/layout/fragment_bootstrap_enter_account_password.xml b/vector/src/main/res/layout/fragment_bootstrap_enter_account_password.xml index cc1e809a6c..d4f4e044ce 100644 --- a/vector/src/main/res/layout/fragment_bootstrap_enter_account_password.xml +++ b/vector/src/main/res/layout/fragment_bootstrap_enter_account_password.xml @@ -49,6 +49,7 @@ android:layout_height="@dimen/layout_touch_size" android:layout_marginTop="8dp" android:background="?attr/selectableItemBackground" + android:contentDescription="@string/a11y_show_password" android:scaleType="center" android:src="@drawable/ic_eye" app:layout_constraintEnd_toEndOf="parent" diff --git a/vector/src/main/res/layout/fragment_bootstrap_migrate_backup.xml b/vector/src/main/res/layout/fragment_bootstrap_migrate_backup.xml index 770fc405a7..d05aad5101 100644 --- a/vector/src/main/res/layout/fragment_bootstrap_migrate_backup.xml +++ b/vector/src/main/res/layout/fragment_bootstrap_migrate_backup.xml @@ -69,6 +69,7 @@ android:layout_height="@dimen/layout_touch_size" android:layout_marginTop="8dp" android:background="?attr/selectableItemBackground" + android:contentDescription="@string/a11y_show_password" android:scaleType="center" android:src="@drawable/ic_eye" app:layout_constraintEnd_toEndOf="parent" diff --git a/vector/src/main/res/layout/fragment_contacts_book.xml b/vector/src/main/res/layout/fragment_contacts_book.xml index 843b15e9f2..0ff64cf657 100644 --- a/vector/src/main/res/layout/fragment_contacts_book.xml +++ b/vector/src/main/res/layout/fragment_contacts_book.xml @@ -29,6 +29,7 @@ android:layout_width="@dimen/layout_touch_size" android:layout_height="@dimen/layout_touch_size" android:clickable="true" + android:contentDescription="@string/action_close" android:focusable="true" android:foreground="?attr/selectableItemBackground" android:scaleType="center" diff --git a/vector/src/main/res/layout/fragment_create_direct_room_directory_users.xml b/vector/src/main/res/layout/fragment_create_direct_room_directory_users.xml index 6a18bdea0b..69e9e658cb 100644 --- a/vector/src/main/res/layout/fragment_create_direct_room_directory_users.xml +++ b/vector/src/main/res/layout/fragment_create_direct_room_directory_users.xml @@ -29,6 +29,7 @@ android:layout_width="@dimen/layout_touch_size" android:layout_height="@dimen/layout_touch_size" android:clickable="true" + android:contentDescription="@string/action_close" android:focusable="true" android:foreground="?attr/selectableItemBackground" android:scaleType="center" diff --git a/vector/src/main/res/layout/fragment_create_room.xml b/vector/src/main/res/layout/fragment_create_room.xml index 015b739dc9..89883fb8b4 100644 --- a/vector/src/main/res/layout/fragment_create_room.xml +++ b/vector/src/main/res/layout/fragment_create_room.xml @@ -29,6 +29,7 @@ android:id="@+id/createRoomClose" android:layout_width="@dimen/layout_touch_size" android:layout_height="@dimen/layout_touch_size" + android:contentDescription="@string/action_close" android:scaleType="center" android:src="@drawable/ic_x_18dp" app:layout_constraintBottom_toBottomOf="parent" diff --git a/vector/src/main/res/layout/fragment_home_drawer.xml b/vector/src/main/res/layout/fragment_home_drawer.xml index e627882d96..642119e5f8 100644 --- a/vector/src/main/res/layout/fragment_home_drawer.xml +++ b/vector/src/main/res/layout/fragment_home_drawer.xml @@ -22,6 +22,7 @@ style="@style/VectorDebug" android:layout_width="@dimen/layout_touch_size" android:layout_height="@dimen/layout_touch_size" + android:importantForAccessibility="no" android:scaleType="center" android:src="@drawable/ic_settings_x" app:layout_constraintEnd_toEndOf="parent" @@ -35,6 +36,7 @@ android:layout_height="50dp" android:layout_marginStart="@dimen/layout_horizontal_margin" android:layout_marginTop="24dp" + android:contentDescription="@string/avatar" android:transitionName="profile" app:layout_constraintStart_toStartOf="parent" app:layout_constraintTop_toTopOf="parent" diff --git a/vector/src/main/res/layout/fragment_keys_backup_restore_from_key.xml b/vector/src/main/res/layout/fragment_keys_backup_restore_from_key.xml index 96401470ac..4920f685db 100644 --- a/vector/src/main/res/layout/fragment_keys_backup_restore_from_key.xml +++ b/vector/src/main/res/layout/fragment_keys_backup_restore_from_key.xml @@ -16,6 +16,7 @@ android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginTop="36dp" + android:importantForAccessibility="no" android:src="@drawable/key_big" app:layout_constraintEnd_toEndOf="parent" app:layout_constraintStart_toStartOf="parent" @@ -67,6 +68,7 @@ android:layout_width="48dp" android:layout_height="48dp" android:background="?attr/selectableItemBackground" + android:contentDescription="@string/a11y_import_key_from_file" android:scaleType="center" android:src="@drawable/ic_import_black" app:layout_constraintEnd_toEndOf="parent" diff --git a/vector/src/main/res/layout/fragment_keys_backup_restore_from_passphrase.xml b/vector/src/main/res/layout/fragment_keys_backup_restore_from_passphrase.xml index b3a243d9c6..817c2e15a7 100644 --- a/vector/src/main/res/layout/fragment_keys_backup_restore_from_passphrase.xml +++ b/vector/src/main/res/layout/fragment_keys_backup_restore_from_passphrase.xml @@ -16,6 +16,7 @@ android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginTop="36dp" + android:importantForAccessibility="no" android:src="@drawable/key_big" app:layout_constraintEnd_toEndOf="parent" app:layout_constraintStart_toStartOf="parent" @@ -67,6 +68,7 @@ android:layout_height="@dimen/layout_touch_size" android:layout_marginTop="8dp" android:background="?attr/selectableItemBackground" + android:contentDescription="@string/a11y_show_password" android:scaleType="center" android:src="@drawable/ic_eye" app:layout_constraintEnd_toEndOf="parent" diff --git a/vector/src/main/res/values/strings.xml b/vector/src/main/res/values/strings.xml index e235e5eb70..38f2001f6d 100644 --- a/vector/src/main/res/values/strings.xml +++ b/vector/src/main/res/values/strings.xml @@ -2829,4 +2829,8 @@ Re-Authentication Needed Element requires you to enter your credentials to perform this action. Failed to authenticate + + Screenshot + Open widgets + Import key from file