1. Overview

When TalkBack lands on an element, it needs three facts. The first is the name: what the element is called. The second is the role: whether it is a button, a checkbox, a heading or plain text. The third is the state, such as checked, selected or expanded. For a slider or a progress bar it also needs the value.

WCAG 2.2 success criterion 4.1.2 Name, role, value asks for exactly this. In EN 301 549 it is clause 11.4.1.2 for software. Clause 11.5.2.5 Object information asks the same through the platform's accessibility services. Images need a text alternative under 11.1.1.1 Non-text content. Form fields need labels under clauses 11.1.3.1 and 11.3.3.2.

Standard components handle most of this for you. A Material Checkbox already reports its role and its state. The work is in the gaps: icons with no text, custom controls, groups of text and form errors. This lesson covers both Jetpack Compose and the older View system. Compose comes first, because Google now documents Compose first.

Standards covered: WCAG 2.2 success criteria 1.1.1, 1.3.1, 2.5.3, 3.3.1, 3.3.2 and 4.1.2 · EN 301 549 V4.1.1 clauses 11.1.1.1, 11.1.3.1, 11.2.5.3, 11.3.3.1, 11.3.3.2, 11.4.1.2, 11.5.2.5, 11.5.2.7 and 11.5.2.8.

Unlock the rest of this lesson

You have read the free preview of Labels, roles and states: content descriptions and Compose semantics in Module 6: Android accessibility. The full lesson, its knowledge check and the module certificate come with a plan, bought here on the web.

Buy a plan here with a card and the rest of the course unlocks. You will sign in first, with Apple or Google, which is what the plan is attached to. No iPhone or Mac needed.

Free with no account: the first lesson, Why accessibility, and who it is for, the European Accessibility Act flashcards and the overview of every lesson.

Sources