Wednesday 4 August 2021

How to get TalkBack to read into nested RecyclerView's contents

I have a RecyclerView, whose cells each contain a complex layout of various Elements such as images, text fields, etc. One of the elements contained within the main RecyclerView's cells is another RecyclerView (it's a grid list of "chips").

When I have TalkBack turned on, tapping on a cell in my main recycler, TalkBack proceeds to read all of the elements within that selected cell except one, that chips recycler view.

The problem I'm having is, it skips the chips RecyclerView altogether. I need it to read the text in each one of the chips before moving on to the next element in the cell.

I've tried just about everything I can think of or have found. I have a feeling there's an outside-the-box answer to this I'm unaware of. Please help. Thanks in advance.

<?xml version="1.0" encoding="utf-8"?>
<merge
    xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:clipChildren="false"
    tools:background="@drawable/things_and_stuff"
    tools:parentTag="androidx.constraintlayout.widget.ConstraintLayout">

<TextView
        android:id="@+id/text_view_that_works"
        android:layout_width="0dp"
        android:layout_height="wrap_content"
        android:layout_marginStart="16dp"
        android:layout_marginTop="16dp"
        android:layout_marginEnd="16dp"
        android:fontFamily="sans-serif-medium"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintTop_toBottomOf="@id/next_item"
        tools:text="Tools Text" />

<!--  Several items skipped for simplification and obfuscation.  -->

<!--  This recycler contains any number of "Chips", which is essentially a text view.
I can make it read if I set it up as an assertive header, but then it reads at the wrong time.  -->
<androidx.recyclerview.widget.RecyclerView
        android:id="@+id/why_does_this_get_skipped"
        android:layout_width="0dp"
        android:layout_height="wrap_content"
        android:layout_marginStart="16dp"
        android:layout_marginTop="8dp"
        android:layout_marginEnd="16dp"
        android:nestedScrollingEnabled="false"
        android:importantForAccessibility="yes"
        android:overScrollMode="never"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintTop_toBottomOf="@id/another_item"
        tools:itemCount="1"
        tools:listitem="@layout/another_layout" />

</merge>


from How to get TalkBack to read into nested RecyclerView's contents

No comments:

Post a Comment