🎨 Palette: [UX improvement] Add semantic button roles to custom clickable TextViews#109
Conversation
Explicitly sets `info.className = android.widget.Button::class.java.name` for custom clickable `TextView`s (IP copy and repo link) within their `AccessibilityDelegateCompat` to ensure screen readers correctly announce them as interactive controls rather than static text. Co-authored-by: manupawickramasinghe <73810867+manupawickramasinghe@users.noreply.github.com>
|
👋 Jules, reporting for duty! I'm here to lend a hand with this pull request. When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down. I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job! For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with New to Jules? Learn more at jules.google/docs. For security, I will only act on instructions from the user who triggered this task. |
There was a problem hiding this comment.
Pull request overview
This PR improves accessibility in CameraFragment by ensuring two clickable TextView elements are announced by TalkBack with an explicit “button” role, making their interactivity more discoverable to screen reader users.
Changes:
- Set
AccessibilityNodeInfoCompat.classNametoandroid.widget.Buttonfor the IP addressTextViewaccessibility node. - Set
AccessibilityNodeInfoCompat.classNametoandroid.widget.Buttonfor the repository linkTextViewaccessibility node. - Documented the semantic-role accessibility learning in
.Jules/palette.md.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| app/src/main/java/com/samsung/android/scan3d/fragments/CameraFragment.kt | Assigns explicit “button” semantics to clickable TextView accessibility nodes via className. |
| .Jules/palette.md | Adds a new accessibility guideline entry about setting semantic roles for custom interactive views. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
💡 What: Assigned explicit semantic button roles to the clickable
TextViewelements (IP address and repository link) by settinginfo.classNamewithin their customAccessibilityDelegateCompat.🎯 Why: Previously, while these elements had custom click actions defined for screen readers, they were still fundamentally announced as "Text," obscuring their interactive affordance. Giving them a button role makes it explicitly clear to TalkBack users that they are interactive elements.
📸 Before/After: No visual changes. This is an accessibility enhancement.
♿ Accessibility: TalkBack now correctly announces these elements as buttons instead of plain text, drastically improving the discoverability of their functionality.
PR created automatically by Jules for task 15619212432079585839 started by @manupawickramasinghe