Talkback automatic descriptions still trying to read decorative image labelled importantForAccessibility=no

18 Views Asked by At

I have a linear layout containing a purely decorative ImageView, and a text view. as such I've labelled the image as importantForAccessibility="no" However, when highlighting the linear layout, Automatic Descriptions is still trying to read out the image, e.g. "Detected: image, [vague description]"

I know that automatic descriptions can be disabled by the user on some devices, but for example Samsung devices don't seem to be able to disable this.

Even so, labelling a view as not important for accessibility should mean that it's ignored by a screen reader. It's not the same as if the view was accidentally unlabelled, when we're specifically asking it to ignore this view.

I'm trying to give a clear and helpful screenreader UX but I can't see a way to prevent these unhelpful descriptions (surely importantForAccessibility=no should be enough?!

trying to get talkback to ignore decorative images, but automatic descriptions is overriding this. Tried labelling as focusable=false, which made no difference

example code (with unneeded detail taken out):

    <LinearLayout
        android:id="@+id/savingsLayout"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:importantForAccessibility="yes"
        android:orientation="vertical">

        <ImageView
            android:id="@+id/savingsIcon"
            android:layout_width="..."
            android:layout_height="..."
            android:importantForAccessibility="no"
            android:src="@drawable/ic_logo" />

        <TextView
            android:id="@+id/savingsAmount"
            android:layout_width="..."
            android:layout_height="..."
            android:importantForAccessibility="no"
            tools:text="You saved £7.15 this time" />

    </LinearLayout>

I want Talkback to read the whole linear layout with just the value of the text view, because then a screenreader user has a larger touch target size if exploring by touch. However, i'm getting "You saved £7.15 this time detected image icon the logo of the website" or some other useless info... help!

0

There are 0 best solutions below