Add dynamic accessibility labels to app-list Internet toggle (#231)#625
Conversation
The app icon in the main list doubles as a button that blocks/allows
Internet access for that app, but had no meaningful contentDescription
for screen readers beyond a static, non-state-aware label added years
ago. Set a dynamic contentDescription in AdapterRule reflecting the
app name and current state ("Block/Allow internet access for X", or
a no-op description when the app has no Internet permission),
updated both on bind and immediately after each tap.
Also label the previously-unlabeled MaterialSwitch toggles in the
per-app tracker details screen (TrackersListAdapter / rule.xml),
which suffer the same class of issue: the per-category "Block"
switch gets a dynamic description naming its category, and the
Tracker Protection / Internet Access / Exclude from VPN switches in
the header get their existing visible labels as contentDescription.
Closes #231
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
|
Thanks—this addresses a real gap and CI is green. One correctness issue remains before merge: the app-icon description ignores |
|
Implemented in |
What changed
Fixes the accessibility gap reported in #231: the app icon in the main app list is actually a button that blocks/allows Internet access for that app, but TalkBack had nothing meaningful to announce beyond a static, non-state-aware
contentDescriptionadded years ago (tracked_app_icon, still present as an inert XML default).app/src/main/java/eu/faircode/netguard/AdapterRule.java: addedupdateToggleContentDescription(), called on bind and again right after each tap, that sets the icon'scontentDescriptionto reflect the app name and current state:app/src/main/res/values/strings.xml: added the three new string resources above, plus one more (see below), in the base (English) file only — translations are expected to follow via the usual localization process.app/src/main/java/net/kollnig/missioncontrol/details/TrackersListAdapter.javaandapp/src/main/res/layout/list_item_trackers_header.xml: extended the same fix to the per-tracker details screen, which has the same class of unlabeled-toggle problem:MaterialSwitchnow gets a dynamic content description naming its tracker category (toggle_block_category_description)contentDescriptionNo behavior/blocking-logic changes — this is purely accessibility labeling, per the issue's scope.
Verification
./gradlew compileGithubDebugJavaWithJavac— BUILD SUCCESSFUL.Part of #231 (kept open as a tracking issue)
🤖 Generated with Claude Code