From bf0bf746ec04466d9f575e89cade5ada9e6298f9 Mon Sep 17 00:00:00 2001 From: the_mr17 Date: Mon, 2 Oct 2023 16:35:13 +0530 Subject: [PATCH 1/6] Fixes performClick warnings --- .../app/player/state/ImageRegionSelectionInteractionView.kt | 4 ++++ .../java/org/oppia/android/app/utility/ClickableAreasImage.kt | 4 +++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/org/oppia/android/app/player/state/ImageRegionSelectionInteractionView.kt b/app/src/main/java/org/oppia/android/app/player/state/ImageRegionSelectionInteractionView.kt index d94b853f1ef..53cb5fd3b1b 100644 --- a/app/src/main/java/org/oppia/android/app/player/state/ImageRegionSelectionInteractionView.kt +++ b/app/src/main/java/org/oppia/android/app/player/state/ImageRegionSelectionInteractionView.kt @@ -91,6 +91,10 @@ class ImageRegionSelectionInteractionView @JvmOverloads constructor( maybeInitializeClickableAreas() } + override fun performClick(): Boolean { + return super.performClick() + } + fun setOnRegionClicked(onRegionClicked: OnClickableAreaClickedListener) { this.onRegionClicked = onRegionClicked maybeInitializeClickableAreas() diff --git a/app/src/main/java/org/oppia/android/app/utility/ClickableAreasImage.kt b/app/src/main/java/org/oppia/android/app/utility/ClickableAreasImage.kt index 69d599fd2de..5093290768b 100644 --- a/app/src/main/java/org/oppia/android/app/utility/ClickableAreasImage.kt +++ b/app/src/main/java/org/oppia/android/app/utility/ClickableAreasImage.kt @@ -30,6 +30,7 @@ class ClickableAreasImage( if (motionEvent.action == MotionEvent.ACTION_DOWN) { onPhotoTap(motionEvent.x, motionEvent.y) } + view.performClick() return@setOnTouchListener false } } @@ -110,10 +111,11 @@ class ClickableAreasImage( newView.isFocusable = true newView.isFocusableInTouchMode = true newView.tag = clickableArea.label - newView.setOnTouchListener { _, event -> + newView.setOnTouchListener { view, event -> if (event.action == MotionEvent.ACTION_DOWN) { showOrHideRegion(newView, clickableArea) } + view.performClick() return@setOnTouchListener true } if (isAccessibilityEnabled) { From d07ddecaf4c0602dbc3b17bbdcf791d1eac58e73 Mon Sep 17 00:00:00 2001 From: the_mr17 Date: Mon, 2 Oct 2023 16:51:43 +0530 Subject: [PATCH 2/6] Fixes focusable warnings --- app/src/main/res/layout/math_expression_parser_fragment.xml | 1 + 1 file changed, 1 insertion(+) diff --git a/app/src/main/res/layout/math_expression_parser_fragment.xml b/app/src/main/res/layout/math_expression_parser_fragment.xml index b69a79c2ad9..ce6208c4ddf 100644 --- a/app/src/main/res/layout/math_expression_parser_fragment.xml +++ b/app/src/main/res/layout/math_expression_parser_fragment.xml @@ -77,6 +77,7 @@ android:background="@drawable/state_button_primary_background" android:clickable="true" android:enabled="true" + android:focusable="true" android:onClick="@{(v) -> viewModel.onParseButtonClicked()}" android:text="@string/math_expression_parse_button_label" android:textSize="14sp" From d3fdb247a3d455da7e35c2d6ad9006ceb13c4ba3 Mon Sep 17 00:00:00 2001 From: the_mr17 Date: Mon, 2 Oct 2023 17:36:51 +0530 Subject: [PATCH 3/6] Fixes contentDescription warnings --- .../layout-land/profile_chooser_fragment.xml | 6 ++++-- .../res/layout-land/topic_info_fragment.xml | 3 ++- .../walkthrough_final_fragment.xml | 3 ++- .../walkthrough_welcome_fragment.xml | 3 ++- .../topic_info_fragment.xml | 3 ++- .../topic_info_fragment.xml | 3 ++- .../profile_chooser_fragment.xml | 6 ++++-- .../res/layout-sw600dp/story_chapter_view.xml | 3 ++- .../activity_view_binding_adapters_test.xml | 3 ++- .../main/res/layout/app_version_fragment.xml | 3 ++- .../main/res/layout/bottom_left_overlay.xml | 6 ++++-- .../main/res/layout/bottom_right_overlay.xml | 6 ++++-- .../res/layout/continue_interaction_item.xml | 3 ++- .../continue_navigation_button_item.xml | 3 ++- app/src/main/res/layout/drawer_fragment.xml | 6 ++++-- .../main/res/layout/exploration_activity.xml | 3 ++- app/src/main/res/layout/next_button_item.xml | 6 ++++-- .../main/res/layout/previous_button_item.xml | 3 ++- .../res/layout/profile_chooser_fragment.xml | 6 ++++-- .../res/layout/profile_picture_activity.xml | 3 ++- .../layout/return_to_topic_button_item.xml | 3 ++- .../res/layout/revision_card_activity.xml | 5 +++-- .../main/res/layout/story_chapter_view.xml | 3 ++- .../main/res/layout/submit_button_item.xml | 3 ++- ...test_drawable_binding_adapter_activity.xml | 3 ++- ...t_image_view_bindable_adapter_activity.xml | 3 ++- .../res/layout/test_url_parser_activity.xml | 3 ++- .../layout/text_input_interaction_item.xml | 1 - app/src/main/res/layout/top_left_overlay.xml | 6 ++++-- app/src/main/res/layout/top_right_overlay.xml | 6 ++++-- .../main/res/layout/topic_info_fragment.xml | 3 ++- .../res/layout/walkthrough_final_fragment.xml | 3 ++- .../layout/walkthrough_welcome_fragment.xml | 3 ++- app/src/main/res/values/strings.xml | 21 +++++++++++++++++++ 34 files changed, 104 insertions(+), 43 deletions(-) diff --git a/app/src/main/res/layout-land/profile_chooser_fragment.xml b/app/src/main/res/layout-land/profile_chooser_fragment.xml index 71ab34ea13a..661da1b5244 100644 --- a/app/src/main/res/layout-land/profile_chooser_fragment.xml +++ b/app/src/main/res/layout-land/profile_chooser_fragment.xml @@ -36,7 +36,8 @@ android:visibility="gone" app:layout_constraintEnd_toEndOf="parent" app:layout_constraintTop_toTopOf="parent" - app:srcCompat="@drawable/ic_language_icon_grey_24dp" /> + app:srcCompat="@drawable/ic_language_icon_grey_24dp" + android:contentDescription="@string/language_icon_content_description" /> + app:srcCompat="@drawable/ic_settings_grey_48dp" + android:contentDescription="@string/setting_icon_content_description" /> diff --git a/app/src/main/res/layout-land/topic_info_fragment.xml b/app/src/main/res/layout-land/topic_info_fragment.xml index 18502150884..33beb578dfb 100644 --- a/app/src/main/res/layout-land/topic_info_fragment.xml +++ b/app/src/main/res/layout-land/topic_info_fragment.xml @@ -105,7 +105,8 @@ app:layout_constraintStart_toStartOf="parent" app:layout_constraintTop_toBottomOf="@+id/see_more_text_view" app:srcCompat="@{viewModel.downloadStatusIndicatorDrawableResourceId, default=@drawable/ic_available_offline_primary_24dp}" - app:tint="@color/component_color_topic_info_fragment_download_status_image_color" /> + app:tint="@color/component_color_topic_info_fragment_download_status_image_color" + android:contentDescription="@string/download_status_content_description" /> + app:srcCompat="@drawable/ic_portrait_onboarding_0" + android:contentDescription="@string/walkthrough_final_content_description" /> + app:srcCompat="@drawable/ic_portrait_onboarding_0" + android:contentDescription="@string/walkthrough_welcome_content_description" />