-
Notifications
You must be signed in to change notification settings - Fork 6.7k
fix(accessibility): Add content description for QR code dialog / [无障碍] 修复二维码弹窗缺失内容描述的问题 #5110
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
| private fun showQRCode(guid: String) { | ||
| val ivBinding = ItemQrcodeBinding.inflate(LayoutInflater.from(mActivity)) | ||
| ivBinding.ivQcode.setImageBitmap(AngConfigManager.share2QRCode(guid)) | ||
| val shareOptions = mActivity.resources.getStringArray(R.array.share_method) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
直接使用目前是没有问题,但是却存在不确定性。
因为后面有可能会调整此项目
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR fixes an accessibility issue where the QR code image in the "Share Server" dialog lacked a content description, causing it to be either announced as "unlabeled image" or skipped entirely by screen readers.
Key Changes:
- Added content description to the QR code ImageView in the showQRCode method
- Reused localized strings from R.array.share_method to ensure proper internationalization
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| val shareOptions = mActivity.resources.getStringArray(R.array.share_method) | ||
| if (shareOptions.isNotEmpty()) { | ||
| ivBinding.ivQcode.contentDescription = shareOptions[0] | ||
| } else { | ||
| ivBinding.ivQcode.contentDescription = "QR Code" | ||
| } |
Copilot
AI
Dec 25, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The indentation of the newly added lines is inconsistent with the rest of the method. The lines setting contentDescription should be indented with 8 spaces (or 2 levels) to match the indentation of the line above (line 203) and below (line 210).
| val shareOptions = mActivity.resources.getStringArray(R.array.share_method) | |
| if (shareOptions.isNotEmpty()) { | |
| ivBinding.ivQcode.contentDescription = shareOptions[0] | |
| } else { | |
| ivBinding.ivQcode.contentDescription = "QR Code" | |
| } | |
| val shareOptions = mActivity.resources.getStringArray(R.array.share_method) | |
| if (shareOptions.isNotEmpty()) { | |
| ivBinding.ivQcode.contentDescription = shareOptions[0] | |
| } else { | |
| ivBinding.ivQcode.contentDescription = "QR Code" | |
| } |
V2rayNG/app/src/main/java/com/v2ray/ang/ui/MainRecyclerAdapter.kt
Outdated
Show resolved
Hide resolved
Co-authored-by: Copilot <[email protected]>
English:
Description
This PR fixes an accessibility issue in the "Share Server" dialog. Previously, the QR code image (iv_qcode) lacked a contentDescription. Depending on the screen reader or system version, this caused two issues:
Changes
Impact
中文:
描述
此 PR 修复了“分享配置文件”弹窗中的一个无障碍问题。此前,二维码图片 (iv_qcode) 缺少 contentDescription 属性。根据屏幕阅读器或系统版本的不同,这会导致以下两种问题:
更改
影响