Accessibility follow-ups: insights contrast, stat grouping, lint sweep#646
Merged
Conversation
#636) Addresses the "Candidate follow-ups" checklist items from the a11y tracking issue: - Raise low-contrast white text and the hardcoded #A5D6A7 percentage on the insights hero gradient to meet WCAG AA (>=4.5:1) against the gradient's lightest stop. - Group each stat number + label in the insights hero card behind a single focusable container with a combined contentDescription, so TalkBack announces "128, Tracker Hosts Contacted" as one unit instead of two separate reads. - Triage `Accessibility` lint findings: add contentDescriptions to the per-app access-log status icon, the busy/metered header icons, and the home-screen widget toggle; mark clearly decorative illustrations (legend icons, onboarding art, insights empty state) as importantForAccessibility="no". Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Member
Author
|
Review finding — localizable accessibility sentence ( |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Refs #636
Summary
Addresses the three "Candidate follow-ups" items from the a11y tracking issue that were in scope for automated work (color contrast, stat grouping, lint triage). The remaining items (on-device TalkBack pass, live-region announcements, focus/traversal order review) are intentionally left for a follow-up, as noted in the issue.
1. Color-contrast fixes (insights hero card)
app/src/main/res/layout/item_insights_header.xmlsits on thebg_insights_herogradient (#8B0000→#B71C1C→#D32F2F, darkest to lightest). Contrast was measured against both the darkest stop (best case) and the lightest stop (worst case, where the text sits over#D32F2F), using the standard WCAG relative-luminance formula.#A5D6A7#F1F8E9(pale green, same accent family)All text now clears 4.5:1 against the gradient's lightest stop, not just the 3:1 "large text" bar. The green accent on the percentage was kept (spirit of the original design) but lightened enough to pass at its actual (non-large-text-only) contrast requirement.
2. Group stat number + label for TalkBack
item_insights_header.xml: each of the three stat blocks (tracking attempts, tracker companies, protection %) is now a singlefocusable="true"LinearLayoutcontainer; the number and labelTextViews inside are markedimportantForAccessibility="no".InsightsHeaderAdapter.onBindViewHoldersets a combinedcontentDescriptionon each container (e.g."128, Tracker Hosts Contacted"), so TalkBack reads each metric as one swipe stop instead of two.3. Lint accessibility triage
Ran
./gradlew :app:lintGithubDebug(full report generated despite the task exiting non-zero on pre-existing, unrelated errors — see Notes). 24ContentDescriptionfindings triaged:Fixed (cheap, in this PR):
AdapterAccess.java(access.xmlivBlock) — per-connection blocked/allowed icon now gets acontentDescription(mirrors the pattern already used for the access-log adapter in Accessibility sweep: label remaining unlabeled controls (#231) #634).ActivityMain.java(actionmain.xmlivQueue/ivMetered) — "busy" and "metered network" header icons now get acontentDescriptionbuilt from their existing toast strings (msg_queue,msg_metered).WidgetMain.java(widgetmain.xmlivEnabled) — home-screen widget toggle now gets a state-awarecontentDescriptionvia new stringswidget_toggle_enable_description/widget_toggle_disable_description.importantForAccessibility="no"(each already has an adjacent text label conveying the same information): 12 icons inlegend.xml, plus the onboarding illustrations initem_onboarding.xml/item_onboarding_blocking_mode.xml, and the insights "no data" empty-state icon inactivity_insights.xml.Remaining (listed, not fixed here):
actionmain.xmlivIcon(master rocket logo / long-press "about" trigger) — ambiguous purpose (branding + hidden gesture), needs a product decision on wording rather than a mechanical fix.log.xmlivConnection/ivInteractive— lint false positive; these already get a dynamiccontentDescriptionset inAdapterLog.javafrom Accessibility sweep: label remaining unlabeled controls (#231) #634, just not statically declared in XML.traffic.xmlivTraffic— a live-drawn traffic-rate graph with no static text equivalent; needs a proper dynamic/summary description, out of scope for a "cheap fix".RtlHardcoded,UseCompoundDrawables,HardcodedText, etc.) are non-accessibility or pre-existing and out of scope for this issue.Not in this PR (per issue, left for follow-up)
Notes
widget_toggle_enable_description,widget_toggle_disable_description) added to base Englishstrings.xmlonly, matching the Add dynamic accessibility labels to app-list Internet toggle (#231) #625/Accessibility sweep: label remaining unlabeled controls (#231) #634 pattern; translations follow via the normal localization process../gradlew :app:lintGithubDebugcurrently fails to exit 0 due to pre-existing, unrelated resource-linking/format errors in translated strings (e.g. a mistranslated@string/...reference invalues-uk-rUA, and a%formatting issue invalues-da-rDK) — these predate this PR and are a known symptom of the Crowdin string-recreation issue tracked separately. The lint report itself still generates correctly and was used for the triage above../gradlew :app:compileGithubDebugJavaWithJavacpasses.🤖 Generated with Claude Code