Skip to content

feat: add accessibility labels to torch and cancel buttons#55

Draft
alexgerardojacinto wants to merge 1 commit into
mainfrom
feat/RMET-5194/alternate-text
Draft

feat: add accessibility labels to torch and cancel buttons#55
alexgerardojacinto wants to merge 1 commit into
mainfrom
feat/RMET-5194/alternate-text

Conversation

@alexgerardojacinto

@alexgerardojacinto alexgerardojacinto commented Jun 11, 2026

Copy link
Copy Markdown
Collaborator

Description

The Torch and Cancel buttons were icon-only with no alternative text, so screen readers could not announce them.

  • Add default English content descriptions to the Cancel (CloseButton) and Torch (TorchButton) buttons. The torch label is state-aware (on vs off).
  • Defaults live as named constants in OSBARCScannerActivity (DEFAULT_CANCEL_ACCESSIBILITY_LABEL, DEFAULT_TORCH_ON_ACCESSIBILITY_LABEL, DEFAULT_TORCH_OFF_ACCESSIBILITY_LABEL).
  • Expose three optional scan parameters so consumers can customize/localize the labels (fall back to the defaults when null/blank): cancelButtonAccessibilityLabel, torchButtonOnAccessibilityLabel, torchButtonOffAccessibilityLabel.

The new parameters are additive/optional, so the change is backward compatible.

Note

Kept as draft to validate end-to-end in the consuming plugins first. The same approach is mirrored in the iOS library: OutSystems/OSBarcodeLib-iOS#45

Context

An accessibility audit flagged that the Torch and Cancel buttons have no alternative text, so they are announced incorrectly by screen readers.

Closes #54

Type of changes

  • Fix (non-breaking change which fixes an issue)
  • Feature (non-breaking change which adds functionality)
  • Refactor (cosmetic changes)
  • Breaking change (change that would cause existing functionality to not work as expected)

Platforms affected

  • Android
  • iOS
  • JavaScript

Tests

  • ./gradlew compileDebugKotlin — BUILD SUCCESSFUL
  • Pending manual validation with TalkBack via the consuming plugin (reason this PR is a draft).

Screenshots (if appropriate)

N/A

Checklist

  • Code follows code style of this project
  • CHANGELOG.md file is correctly updated
  • Changes require an update to the documentation
    • Documentation has been updated accordingly

The torch and cancel buttons were icon-only with no alternative text,
so screen readers could not announce them.

Add default English content descriptions and expose optional
cancelButtonAccessibilityLabel, torchButtonOnAccessibilityLabel and
torchButtonOffAccessibilityLabel scan parameters so consumers can
customize/localize them.

Closes #54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Missing alternative text on Cancel and Torch buttons

1 participant