-
Notifications
You must be signed in to change notification settings - Fork 24.3k
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
Override default Talkback automatic content grouping and generate a custom contentDescription #33690
Commits on Apr 6, 2022
-
Configuration menu - View commit details
-
Copy full SHA for 05a2bc3 - Browse repository at this point
Copy the full SHA 05a2bc3View commit details
Commits on Apr 11, 2022
-
Configuration menu - View commit details
-
Copy full SHA for 4ffd15d - Browse repository at this point
Copy the full SHA 4ffd15dView commit details
Commits on Apr 13, 2022
-
Configuration menu - View commit details
-
Copy full SHA for 5e1622f - Browse repository at this point
Copy the full SHA 5e1622fView commit details
Commits on Apr 14, 2022
-
Configuration menu - View commit details
-
Copy full SHA for 28f86a3 - Browse repository at this point
Copy the full SHA 28f86a3View commit details
Commits on Apr 15, 2022
-
Configuration menu - View commit details
-
Copy full SHA for 963cd17 - Browse repository at this point
Copy the full SHA 963cd17View commit details
Commits on Apr 21, 2022
-
Configuration menu - View commit details
-
Copy full SHA for 69473de - Browse repository at this point
Copy the full SHA 69473deView commit details -
Configuration menu - View commit details
-
Copy full SHA for bdabc4c - Browse repository at this point
Copy the full SHA bdabc4cView commit details
Commits on Apr 22, 2022
-
Configuration menu - View commit details
-
Copy full SHA for ae66001 - Browse repository at this point
Copy the full SHA ae66001View commit details -
Configuration menu - View commit details
-
Copy full SHA for 7c287a4 - Browse repository at this point
Copy the full SHA 7c287a4View commit details -
Configuration menu - View commit details
-
Copy full SHA for 6d73cd4 - Browse repository at this point
Copy the full SHA 6d73cd4View commit details -
Configuration menu - View commit details
-
Copy full SHA for 2a3a836 - Browse repository at this point
Copy the full SHA 2a3a836View commit details -
Configuration menu - View commit details
-
Copy full SHA for 982fb20 - Browse repository at this point
Copy the full SHA 982fb20View commit details
Commits on Apr 25, 2022
-
Conditions that should trigger the custom contentDescription
facebook#33690 (comment) The custom contentDescription should be triggered if: - an element has no contentDescription **AND** text - **AND** has other content to announce (role, state, etc.)
Configuration menu - View commit details
-
Copy full SHA for e0e1629 - Browse repository at this point
Copy the full SHA e0e1629View commit details -
remove check on accessibilityLabel
the check on the contentDescription is enough also for the accessibilityLabel https://github.com/fabriziobertoglio1987/react-native/blob/e0e162921c183e4203fd64c35b2f1a29c6e1ef4f/ReactAndroid/src/main/java/com/facebook/react/uimanager/BaseViewManager.java#L233
Configuration menu - View commit details
-
Copy full SHA for a22c435 - Browse repository at this point
Copy the full SHA a22c435View commit details
Commits on Apr 26, 2022
-
Configuration menu - View commit details
-
Copy full SHA for 07bac60 - Browse repository at this point
Copy the full SHA 07bac60View commit details -
Configuration menu - View commit details
-
Copy full SHA for 821e623 - Browse repository at this point
Copy the full SHA 821e623View commit details -
Configuration menu - View commit details
-
Copy full SHA for 35190c0 - Browse repository at this point
Copy the full SHA 35190c0View commit details
Commits on Apr 27, 2022
-
Configuration menu - View commit details
-
Copy full SHA for 986b10b - Browse repository at this point
Copy the full SHA 986b10bView commit details -
Configuration menu - View commit details
-
Copy full SHA for 28ed277 - Browse repository at this point
Copy the full SHA 28ed277View commit details -
Configuration menu - View commit details
-
Copy full SHA for e1521cf - Browse repository at this point
Copy the full SHA e1521cfView commit details -
Configuration menu - View commit details
-
Copy full SHA for 90dd4a8 - Browse repository at this point
Copy the full SHA 90dd4a8View commit details -
Configuration menu - View commit details
-
Copy full SHA for 5e7aaf3 - Browse repository at this point
Copy the full SHA 5e7aaf3View commit details -
Configuration menu - View commit details
-
Copy full SHA for 1f06997 - Browse repository at this point
Copy the full SHA 1f06997View commit details -
Returns a cached instance if such is available or a new one is create.
The returned instance is initialized from the given <code>info</code>.
Configuration menu - View commit details
-
Copy full SHA for a05b912 - Browse repository at this point
Copy the full SHA a05b912View commit details
Commits on Apr 28, 2022
-
- node.recycle does not trigger runtime as we use obtain(AccessibilityNodeInfo info) - setContentDescription(null) will use the default content description (Button, Text number 1, Text number 2) which is the existing behaviour
Configuration menu - View commit details
-
Copy full SHA for 64bb48a - Browse repository at this point
Copy the full SHA 64bb48aView commit details
Commits on May 24, 2022
-
Configuration menu - View commit details
-
Copy full SHA for 7cf8fce - Browse repository at this point
Copy the full SHA 7cf8fceView commit details -
Configuration menu - View commit details
-
Copy full SHA for 0b620e0 - Browse repository at this point
Copy the full SHA 0b620e0View commit details
Commits on May 26, 2022
-
check for isScreenReaderFocusable and hasHint
adding check on hintText in hasText method the "hint text" for EditText's also counts as content, as it's still announced when the EditText has no text or contentDescription. See Talkbacks implementation here for reference: https://github.com/google/talkback/blob/6c0b475b7f52469e309e51bfcc13de58f18176ff/utils/src/main/java/com/google/android/accessibility/utils/AccessibilityNodeInfoUtils.java#L1663 facebook#33690 (comment) adding check for isScreenReaderFocusable in isAccessibilityFocusable See Talkback's implementation here for reference: https://github.com/google/talkback/blob/6c0b475b7f52469e309e51bfcc13de58f18176ff/utils/src/main/java/com/google/android/accessibility/utils/AccessibilityNodeInfoUtils.java#L1690 facebook#33690 (comment)
Configuration menu - View commit details
-
Copy full SHA for 45e3040 - Browse repository at this point
Copy the full SHA 45e3040View commit details -
Configuration menu - View commit details
-
Copy full SHA for 5488aba - Browse repository at this point
Copy the full SHA 5488abaView commit details -
test child with accessibilityValue, state, label
The regression is caused by the missing logic in https://github.com/facebook/flipper/blob/e44cad5e9912b359378a43ec47c5a49bbca85fc3/android/src/main/java/com/facebook/flipper/plugins/inspector/descriptors/utils/AccessibilityUtil.java#L477-L491 Also needs to verify the following cases with EditText https://github.com/facebook/flipper/blob/e44cad5e9912b359378a43ec47c5a49bbca85fc3/android/src/main/java/com/facebook/flipper/plugins/inspector/descriptors/utils/AccessibilityUtil.java#L500-L516
Configuration menu - View commit details
-
Copy full SHA for 751b83e - Browse repository at this point
Copy the full SHA 751b83eView commit details -
add addStateSegments to custom announcement
The previous developed functionality would remove the following announcements from the child nodes: - state - disabled - accessibilityRole (for the child) The fields were not retrieved/added to the new Talkback announcement Fixes regression tested in example 751b83e the current announcement have been added, the other will follow up in the next commits: - state
Configuration menu - View commit details
-
Copy full SHA for e3edefb - Browse repository at this point
Copy the full SHA e3edefbView commit details -
Configuration menu - View commit details
-
Copy full SHA for a0fb221 - Browse repository at this point
Copy the full SHA a0fb221View commit details
Commits on May 27, 2022
-
Configuration menu - View commit details
-
Copy full SHA for d2c8bfb - Browse repository at this point
Copy the full SHA d2c8bfbView commit details -
Configuration menu - View commit details
-
Copy full SHA for 334b24d - Browse repository at this point
Copy the full SHA 334b24dView commit details -
Configuration menu - View commit details
-
Copy full SHA for 9d72a70 - Browse repository at this point
Copy the full SHA 9d72a70View commit details -
Configuration menu - View commit details
-
Copy full SHA for 9d1bf23 - Browse repository at this point
Copy the full SHA 9d1bf23View commit details
Commits on May 30, 2022
-
Configuration menu - View commit details
-
Copy full SHA for abed89e - Browse repository at this point
Copy the full SHA abed89eView commit details
Commits on Jun 1, 2022
-
Configuration menu - View commit details
-
Copy full SHA for b90fff4 - Browse repository at this point
Copy the full SHA b90fff4View commit details -
Configuration menu - View commit details
-
Copy full SHA for f1852f1 - Browse repository at this point
Copy the full SHA f1852f1View commit details -
Configuration menu - View commit details
-
Copy full SHA for 6bd06c4 - Browse repository at this point
Copy the full SHA 6bd06c4View commit details -
https://app.circleci.com/pipelines/github/facebook/react-native/13665/workflows/efdceb92-2020-4ca4-8317-f3889b0b7800/jobs/258498 ``` Cannot create `TouchableNativeFeedback` element because property `style` is missing in `Props` [1] but exists in props [2]. [prop-missing] packages/rn-tester/js/examples/Accessibility/AccessibilityExample.js:264:16 264| <TouchableNativeFeedback ^^^^^^^^^^^^^^^^^^^^^^^ References: Libraries/Components/Touchable/TouchableNativeFeedback.js:97:55 97| class TouchableNativeFeedback extends React.Component<Props, State> { ^^^^^ [1] packages/rn-tester/js/examples/Accessibility/AccessibilityExample.js:264:15 v----------------------- 264| <TouchableNativeFeedback 265| style={{ 266| height: 100, 267| width: 100, 268| backgroundColor: 'yellow', 269| }} 270| focusable={true} 271| onPress={() => console.warn('onPress child')} 272| accessible={false} 273| accessibilityLabel="this is my label" 274| accessibilityRole="image" 275| accessibilityState={{disabled: true}} 276| accessibilityValue={{text: 'this is the accessibility value'}}> 277| <Text accessible={false}>Text number 3</Text> 278| </TouchableNativeFeedback> -------------------------^ [2] Found 1 error error Command failed with exit code 2. info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command. Failed to run flow. Finished. /home/circleci/react-native/scripts/run-ci-javascript-tests.js:47 throw Error(exitCode); ^ Error: 1 at Object.<anonymous> (/home/circleci/react-native/scripts/run-ci-javascript-tests.js:47:11) at Module._compile (node:internal/modules/cjs/loader:1103:14) at Object.Module._extensions..js (node:internal/modules/cjs/loader:1157:10) at Module.load (node:internal/modules/cjs/loader:981:32) at Function.Module._load (node:internal/modules/cjs/loader:822:12) at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:77:12) at node:internal/main/run_main_module:17:47 Exited with code exit status 1 ```
Configuration menu - View commit details
-
Copy full SHA for 2dc702e - Browse repository at this point
Copy the full SHA 2dc702eView commit details -
Configuration menu - View commit details
-
Copy full SHA for 8622c13 - Browse repository at this point
Copy the full SHA 8622c13View commit details -
Configuration menu - View commit details
-
Copy full SHA for e4b31c3 - Browse repository at this point
Copy the full SHA e4b31c3View commit details
Commits on Jun 2, 2022
-
Revert "moving getRoleDescription to another branch"
This reverts commit 8622c13.
Configuration menu - View commit details
-
Copy full SHA for 251df27 - Browse repository at this point
Copy the full SHA 251df27View commit details
Commits on Jun 3, 2022
-
Configuration menu - View commit details
-
Copy full SHA for 8aa5b25 - Browse repository at this point
Copy the full SHA 8aa5b25View commit details -
removing accessibilityRole functionality as not required from specs
if the child has a role defined, it should probably also be accessible on its own, and therefore won't get pulled up into its parents announcement in the first place. facebook#30719 (comment)
Configuration menu - View commit details
-
Copy full SHA for b804bd0 - Browse repository at this point
Copy the full SHA b804bd0View commit details -
Configuration menu - View commit details
-
Copy full SHA for f77a4a2 - Browse repository at this point
Copy the full SHA f77a4a2View commit details -
Moving not required logic to a separate branch
based on my personal notes from the last meeting and the below comment facebook#30719 (comment)
Configuration menu - View commit details
-
Copy full SHA for 44122ff - Browse repository at this point
Copy the full SHA 44122ffView commit details
Commits on Jun 6, 2022
-
Configuration menu - View commit details
-
Copy full SHA for cb0e1b6 - Browse repository at this point
Copy the full SHA cb0e1b6View commit details -
Scenarios: - 3 levels of nested components 10min - the contentDescription is not empty and does not have nodeText - contentDescription is not empty and is not an EditText - contentDescription is empty, is an EditText and has a nodeText
Configuration menu - View commit details
-
Copy full SHA for 0c79fc8 - Browse repository at this point
Copy the full SHA 0c79fc8View commit details -
Configuration menu - View commit details
-
Copy full SHA for 46826d8 - Browse repository at this point
Copy the full SHA 46826d8View commit details -
Configuration menu - View commit details
-
Copy full SHA for ad6732a - Browse repository at this point
Copy the full SHA ad6732aView commit details
Commits on Jun 7, 2022
-
Configuration menu - View commit details
-
Copy full SHA for d5f4c9c - Browse repository at this point
Copy the full SHA d5f4c9cView commit details
Commits on Jun 8, 2022
-
One of the child has accessibilityState (hasStateDescription triggers…
… the announcement) from facebook#33690 (comment) I noticed that getStateDescription returns null even when adding accessibilityState. Calling setStateDescription will update the state description, which is not set via the react accessibilityState or other props. Seems that the method [setViewState](https://github.com/fabriziobertoglio1987/react-native/blob/ad6732aa3576786d37478a729b112031dd94b682/ReactAndroid/src/main/java/com/facebook/react/uimanager/BaseViewManager.java#L254) does not call setStateDescription. I will further investigate tomorrow. <details><summary>View#setStateDescription</summary> <p> ```java /** * Sets the {@link View}'s state description. * <p> * A state description briefly describes the states of the view and is primarily used * for accessibility support to determine how the states of a view should be presented to * the user. It is a supplement to the boolean states (for example, checked/unchecked) and * it is used for customized state description (for example, "wifi, connected, three bars"). * State description changes frequently while content description should change less often. * State description should be localized. For android widgets which have default state * descriptions, app developers can call this method to override the state descriptions. * Setting state description to null restores the default behavior. * * @param stateDescription The state description. * @see #getStateDescription() */ @RemotableViewMethod public void setStateDescription(@nullable CharSequence stateDescription) { if (mStateDescription == null) { if (stateDescription == null) { return; } } else if (mStateDescription.equals(stateDescription)) { return; } mStateDescription = stateDescription; if (!TextUtils.isEmpty(stateDescription) && getImportantForAccessibility() == IMPORTANT_FOR_ACCESSIBILITY_AUTO) { setImportantForAccessibility(IMPORTANT_FOR_ACCESSIBILITY_YES); } if (AccessibilityManager.getInstance(mContext).isEnabled()) { AccessibilityEvent event = AccessibilityEvent.obtain(); event.setEventType(AccessibilityEvent.TYPE_WINDOW_CONTENT_CHANGED); event.setContentChangeTypes(AccessibilityEvent.CONTENT_CHANGE_TYPE_STATE_DESCRIPTION); sendAccessibilityEventUnchecked(event); } } ``` </p> </details> This is the implementation of TalkBack [hasStateDescription](https://github.com/google/talkback/blob/6c0b475b7f52469e309e51bfcc13de58f18176ff/utils/src/main/java/com/google/android/accessibility/utils/AccessibilityNodeInfoUtils.java#L1672-L1677). The following fields of the view are set with the accessibilityState: - [checkable](https://github.com/fabriziobertoglio1987/react-native/blob/ad6732aa3576786d37478a729b112031dd94b682/ReactAndroid/src/main/java/com/facebook/react/uimanager/ReactAccessibilityDelegate.java#L411) => BOOLEAN_PROPERTY_CHECKABLE - [enabled](https://github.com/fabriziobertoglio1987/react-native/blob/ad6732aa3576786d37478a729b112031dd94b682/ReactAndroid/src/main/java/com/facebook/react/uimanager/ReactAccessibilityDelegate.java#L408) => BOOLEAN_PROPERTY_ENABLED <details><summary>setCheckable</summary> <p> https://github.com/aosp-mirror/platform_frameworks_base/blob/19e53cfdc8a5c6ef45c0adf2dd239576ddce5822/core/java/android/view/accessibility/AccessibilityNodeInfo.java#L2008 ```java /** * Sets whether this node is checkable. * <p> * <strong>Note:</strong> Cannot be called from an * {@link android.accessibilityservice.AccessibilityService}. * This class is made immutable before being delivered to an AccessibilityService. * </p> * * @param checkable True if the node is checkable. * * @throws IllegalStateException If called from an AccessibilityService. */ public void setCheckable(boolean checkable) { setBooleanProperty(BOOLEAN_PROPERTY_CHECKABLE, checkable); } ``` </p> </details> <details><summary>setEnabled</summary> <p> https://github.com/aosp-mirror/platform_frameworks_base/blob/19e53cfdc8a5c6ef45c0adf2dd239576ddce5822/core/java/android/view/accessibility/AccessibilityNodeInfo.java#L2227 ```java /** * Sets whether this node is enabled. * <p> * <strong>Note:</strong> Cannot be called from an * {@link android.accessibilityservice.AccessibilityService}. * This class is made immutable before being delivered to an AccessibilityService. * </p> * * @param enabled True if the node is enabled. * * @throws IllegalStateException If called from an AccessibilityService. */ public void setEnabled(boolean enabled) { setBooleanProperty(BOOLEAN_PROPERTY_ENABLED, enabled); } ``` </p> </details> The implementation of `hasStateDescription` is still valid
Configuration menu - View commit details
-
Copy full SHA for c17f00e - Browse repository at this point
Copy the full SHA c17f00eView commit details -
Configuration menu - View commit details
-
Copy full SHA for 087e642 - Browse repository at this point
Copy the full SHA 087e642View commit details -
Configuration menu - View commit details
-
Copy full SHA for 51f23f0 - Browse repository at this point
Copy the full SHA 51f23f0View commit details -
Configuration menu - View commit details
-
Copy full SHA for 8b84521 - Browse repository at this point
Copy the full SHA 8b84521View commit details
Commits on Aug 11, 2022
-
Configuration menu - View commit details
-
Copy full SHA for dc0cc5a - Browse repository at this point
Copy the full SHA dc0cc5aView commit details
Commits on Aug 30, 2022
-
Configuration menu - View commit details
-
Copy full SHA for eac460e - Browse repository at this point
Copy the full SHA eac460eView commit details -
updating examples in AccessibilityExample
This example feels a bit odd to me. The state itself is not concatenated into the announcement, which makes sense, as it would lead to potentially announcing conflicting state if two child elements had separate states like "checked" and "unchecked", but because of this I'm not sure what value this example is providing. If there was no state here and just the label it would work the exact same way. I think we can probably just remove this one and maybe replace it with one where the parent element has a state and making sure that state is reflected even when the children are combined into it. facebook#33690 (comment) facebook#33690 (comment) I don't think importantForAccessibility="yes" is necessary for any of these examples, so lets remove it on all of them just to make it clear that this isn't a prequalification for this feature working. facebook#33690 (comment) Remove duplicate example (this is the same as the previous one) facebook#33690 (comment)
Configuration menu - View commit details
-
Copy full SHA for ddfb345 - Browse repository at this point
Copy the full SHA ddfb345View commit details -
Configuration menu - View commit details
-
Copy full SHA for 11c4b00 - Browse repository at this point
Copy the full SHA 11c4b00View commit details