-
-
Notifications
You must be signed in to change notification settings - Fork 3.4k
Accessibility improvements #12956
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
base: refactor
Are you sure you want to change the base?
Accessibility improvements #12956
Conversation
This is necessary if it is not clear which fragment is available.
The code for the matching StreamDialogEntries was copy-pasted. It is now possible to use the entries directly.
|
Thank you for the PR! I made a few changes to deduplicate the code which was mostly copied from This is good to go once my question below is answered. |
| // Ensure the fragment in the activity is attached | ||
| // and its state hasn't been saved to avoid | ||
| // showing dialog during lifecycle changes or when the activity is paused, | ||
| // e.g. by selecting the download option and opening a different fragment. | ||
| if (fragment.isAdded() && !fragment.isStateSaved()) { | ||
| final FragmentManager fm = fragmentActivity.getSupportFragmentManager(); | ||
| if (!fm.isStateSaved()) { | ||
| final DownloadDialog downloadDialog = | ||
| new DownloadDialog(fragment.requireContext(), info); | ||
| downloadDialog.show(fragment.getChildFragmentManager(), | ||
| "downloadDialog"); | ||
| new DownloadDialog(fragmentActivity, info); | ||
| downloadDialog.show(fm, "downloadDialog"); | ||
| } |
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.
@Stypox I am not quite sure about the change I made here. Is the check even necessary anymore because we are now using the activity? Should fragementActivity.isDestroyed() or fragementActivity.isFinishing() be used instead? The check was initially introduced to ensure that opening the dialog would not lead to a crash when the fragment was closed while loading the fetching the required info, e.g. by going back.
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.
@TobiGr Thanks for the review and the cleanup! I appreciate you handling the deduplication!
What is it?
refactorbranchDescription of the changes in your PR
This PR significantly improves the application's accessibility for screen reader (TalkBack) users without affecting the visual UI for sighted users.
AccessibilityDelegateinStreamMiniInfoItemHolder. This exposes the long-press context menu options (Enqueue, Download, Share, Play in Background, etc.) as native Accessibility Custom Actions. Users can now swipe to select an action rather than using the "double-tap and hold" gesture.android:contentDescriptionattributes to the queue control buttons (Repeat, Shuffle, Rewind, Fast Forward). These buttons previously read as "Unlabelled" to screen readers.android:importantForAccessibility="no"on list item thumbnails. This reduces navigation clutter, as the list item itself already contains the title and click action.Before/After Screenshots/Screen Record
No visual changes. These changes affect Accessibility services (TalkBack) behavior only.
Fixes the following issue(s)
Relies on the following changes
APK testing
The APK can be found by going to the "Checks" tab below the title. On the left pane, click on "CI", scroll down to "artifacts" and click "app" to download the zip file which contains the debug APK of this PR. You can find more info and a video demonstration on this wiki page.
Due diligence