Overview › Accessibility Audit (Android)

Accessibility Audit (Android)

Generated 2026-05-11 · Costco Android

Why this matters

Every ImageView, ImageButton, Image, Icon, and IconButton that conveys meaning needs an android:contentDescription (XML) or contentDescription = stringResource(...) (Compose). Without it:

Decision matrix — when to label, when to mark decorative

Image purposeWhat to set
Conveys information (logo, status icon, illustration)contentDescription = stringResource(R.string.…)
Acts on tap (icon button, cart icon, close button)contentDescription describing the action ("Close", "Add to cart")
Pure decoration (separator, background, ornamental)XML: android:importantForAccessibility="no"
Compose: contentDescription = null with explicit comment
Repetitive (50 product cards each with their own image)Label on the card, not each child element. Card describes "View Bounty paper towels, $19.99"

Audit findings

Missing contentDescription on actionable XML images

15 sites identified — each is an icon that does something on tap, with no announcement for assistive technology.

FileLineIconAction
Costco/.../view_warehouse_details.xml64ic_blue_driving_directionsOpen driving directions to warehouse
Costco/.../view_warehouse_details.xml86ic_blue_telephoneCall warehouse
Costco/.../row_search_suggestion.xml26arrow_insert (ImageButton)Insert search suggestion
Costco/.../view_warehouse_comingsoon_details.xml95ic_blue_driving_directionsDriving directions (duplicate)
Costco/.../view_standalone_gas_details.xml96ic_blue_driving_directionsDriving directions
Costco/.../fragment_event_detail.xml19Event image (ViewFlipper)Visual content carrying meaning
Costco/.../list_item_saving_card.xml51ic_calendar_blueIndicates expiration date
Costco/.../fragment_warehouse_offer_details.xml24Offer detail imageOffer artwork carrying meaning
Costco/.../list_item_warehouse_offer.xml50ic_calendar_blueDate indicator
Costco/.../view_main_toolbar.xml54ic_logo_transparentLogo (decorative — should be marked so)
Costco/.../quick_action.xml36ic_user_iconUser profile shortcut

Empty / null contentDescription on actionable elements (anti-pattern)

FileLineIssue
Costco/.../fragment_findastore.xml11RelativeLayout with contentDescription=""
Costco/.../fragment_findastore.xml21MapView with contentDescription="" — TalkBack reads as silent
Costco/.../view_warehouse_navigation_button.xml20ImageView with contentDescription=""
Costco/.../list_item_nearby_warehouses.xml44Gas-station icon with contentDescription="@null" on an actionable element (drawable name suggests action, not decoration)

Hardcoded font sizes — Dynamic Type / "Large Text" ignored

WCAG 1.4.4 requires text to scale up to 200%. The following sites hardcode android:textSize or Compose fontSize instead of using MaterialTheme.typography / ?attr/textAppearanceBody1. Users with the system "Large Text" setting see clipped, overlapping content.

FileLinetextSize
Costco/.../fragment_onboarding.xml5624sp (header)
Costco/.../fragment_onboarding.xml7416sp (body)
Costco/.../fragment_onboarding.xml9616sp (instruction)
Costco/.../view_warehouse_details.xml127, 141, 15414sp × 3 (warehouse details)
Costco/.../fragment_feature_highlights.xml8724sp (headline)
Costco/.../view_warehouse_comingsoon_details.xml8112sp (caption)
shared/geofence/.../layout_notification_collapsed.xml22, 3114sp + 13sp (notification)
feature/warehouse/.../layout_notification_expanded.xml23, 3214sp + 13sp (notification)

Plus 30+ more sites across the codebase. Recommendation: sweep all hardcoded textSize values; replace with ?attr/textAppearanceHeadline6, textAppearanceBody1, etc., or with explicit Material/Material3 type tokens.

Hardcoded text strings — bypass localization + accessibility services

Hardcoded strings in XML are not picked up by translators, can't be intercepted by per-app language preferences (Android 13+), and break TalkBack's pronunciation in non-English locales. Sample (likely many more):

Hot files (most violations)

  1. Costco/src/main/res/layout/view_warehouse_details.xml — 6 violations (3 missing img descriptions + 3 hardcoded fonts)
  2. Costco/src/main/res/layout/fragment_onboarding.xml — 5 violations (all DYNAMIC_TYPE)
  3. shared/geofence/.../layout_notification_collapsed.xml — 4 violations (all fonts)
  4. Costco/src/main/res/layout/view_warehouse_comingsoon_details.xml — 4 violations (1 missing desc + 3 fonts)
  5. Costco/src/main/res/layout/fragment_feature_highlights.xml — 4 violations (all fonts)

How fixing this helps automation

The same labels that announce intent to users are what automation frameworks use to find elements. After labeling:

FrameworkBefore (brittle)After (resilient)
EspressoonView(withId(R.id.fragment_warehouseDetails_telephone_image))onView(withContentDescription("Call warehouse"))
Compose UI TestonNodeWithTag("phone_icon")onNodeWithContentDescription("Call warehouse")
UI Automator (E2E)By.res(...)By.desc("Call warehouse")
BrowserStack App Live / SauceLabsXPath into resource-idAccessibility ID query

The automation team can drop XPath/resource-id selectors entirely once labels exist. Tests stop breaking on every layout refactor. New features can ship UI tests without first wiring up resource IDs. Cross-platform tests (Appium, etc.) can use the same accessibility ID on Android and iOS — your labels become a stable contract.

Migration plan

  1. Sprint 1 — Add android:contentDescription to the 15 actionable XML icons. Each goes via a string resource so localization picks it up. Sweepable in 1 day.
  2. Sprint 1 — Replace contentDescription="" and incorrect "@null" with proper resource strings or android:importantForAccessibility="no".
  3. Sprint 2 — Sweep hardcoded android:textSize values; convert to text-appearance attributes. Snapshot test at fontScale = 2.0.
  4. Sprint 2 — Sweep hardcoded UI strings into strings.xml.
  5. Ongoing — Enable Android Lint rule ContentDescription at error severity in CI. Enable HardcodedText rule. Re-baseline.
  6. Ongoing — Add a fontScale = 2.0 snapshot test pass in the existing screenshot test plan.

Verification

Costco Android · Code Review Report · Generated 2026-05-11 · 626 machine-curated findings