| name | android-accessibility |
| description | Use when improving app accessibility, ensuring WCAG compliance, or fixing TalkBack navigation for Android. |
| category | accessibility |
| risk | low |
| source | community |
| date_added | 2026-03-31 |
| metadata | {"triggers":["@accessibility","wcag-compliance","talkback-support","content-description","semantic-tags"]} |
Android Accessibility Excellence ♿🛡️
Standard practices for creating inclusive, easy-to-use Android applications that comply with WCAG 2.1+ standards.
⚡ When to Use
- Accessibility Audit: Reviewing current UI for screen reader issues.
- Compose Semantics: Customizing how UI elements are announced.
- Contrast Ratios: Ensuring text is readable for low-vision users.
- Screen Reader Support: Optimizing navigation with TalkBack.
- Touch Target Sizes: Ensuring buttons and links are easy to hit.
🏗️ The 4 Principles (POUR)
- Perceivable: Users can perceive all info via sight, sound, or touch.
- Operable: Users can interact with the app via various methods.
- Understandable: UI and navigation are predictable.
- Robust: Compatible with many assistive tools.
🛠️ Compose Semantics Essentials
1. contentDescription
- Rule: Every
Image, IconButton, or clickable decorative icon MUST have a descriptive contentDescription.
- Bad:
contentDescription = "icon" or null for meaningful icons.
- Good:
contentDescription = "Search for products" or contentDescription = null for purely decorative items.
2. Semantic Properties
- Use
Modifier.semantics { ... } for custom descriptions or element roles.
- Use
Modifier.clearAndSetSemantics { ... } to hide complex child hierarchies from screen readers.
3. Merging Descendants
📐 Design Best Practices
- Contrast: Aim for 4.5:1 for normal text and 3:1 for large text.
- Touch Targets: Minimum size of 48dp x 48dp.
- Dynamic Type: Ensure layouts resize correctly for large font scales (
@PreviewFontScales).
🧪 Testing and Verification
- Accessibility Scanner: Use the Google app to automatically scan screens for common issues.
- TalkBack: Manually test with the screen reader enabled on a physical device.
- Lint Checks: Enable
@LintRule for missing contentDescription.
📜 Checklist for Developers
🔗 Related Resources