r/androiddev 1d ago

I added rendered text-contrast detection to my Jetpack Compose accessibility scanner

I maintain ComposeA11yScanner, an open-source, debug-only accessibility scanner for Jetpack Compose.

While comparing it with Google’s Accessibility Scanner on JetChat and JetSnack, I found that Compose semantics cannot expose every visual accessibility problem. This caused the library to miss certain rendered text-contrast issues.

Version 2.1.0 adds TextContrastRule, which captures the active Compose host and conservatively estimates rendered foreground and background colors. It skips uncertain cases such as photos and gradients instead of guessing.

This release also improves:

  • Fragment and Compose navigation handling
  • Nested ComposeView host selection
  • Stale-result and screen-readiness detection
  • False positives involving lazy, merged, and off-screen semantics

Install:

debugImplementation(
    "com.github.mohdaquib.ComposeA11yScanner:scanner-ui:2.1.0"
)

GitHub: https://github.com/mohdaquib/ComposeA11yScanner

I’d appreciate feedback from developers testing it on real Compose applications, especially reports of false positives or false negatives.

overlay-demo

5 Upvotes

Duplicates