-
Notifications
You must be signed in to change notification settings - Fork 6k
Handle a11y focus event on Ios and android #41777
Conversation
This comment was marked as outdated.
This comment was marked as outdated.
shell/platform/android/io/flutter/embedding/engine/systemchannels/AccessibilityChannel.java
Outdated
Show resolved
Hide resolved
shell/platform/android/io/flutter/embedding/engine/systemchannels/AccessibilityChannel.java
Outdated
Show resolved
Hide resolved
shell/platform/android/io/flutter/view/AccessibilityBridge.java
Outdated
Show resolved
Hide resolved
...atform/android/test/io/flutter/embedding/engine/systemchannels/AccessibilityChannelTest.java
Show resolved
Hide resolved
...atform/android/test/io/flutter/embedding/engine/systemchannels/AccessibilityChannelTest.java
Outdated
Show resolved
Hide resolved
shell/platform/darwin/ios/framework/Source/accessibility_bridge.mm
Outdated
Show resolved
Hide resolved
|
Golden file changes have been found for this pull request. Click here to view and triage (e.g. because this is an intentional change). If you are still iterating on this change and are not ready to resolve the images on the Flutter Gold dashboard, consider marking this PR as a draft pull request above. You will still be able to view image results on the dashboard, commenting will be silenced, and the check will not try to resolve itself until marked ready for review. |
...atform/android/test/io/flutter/embedding/engine/systemchannels/AccessibilityChannelTest.java
Show resolved
Hide resolved
shell/platform/darwin/ios/framework/Source/accessibility_bridge.mm
Outdated
Show resolved
Hide resolved
chunhtai
left a comment
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.
LGTM
| ArgumentCaptor.forClass(AccessibilityEvent.class); | ||
| verify(mockParent).requestSendAccessibilityEvent(eq(mockRootView), eventCaptor.capture()); | ||
| AccessibilityEvent event = eventCaptor.getAllValues().get(0); | ||
| assertEquals(event.getEventType(), AccessibilityEvent.TYPE_VIEW_FOCUSED); |
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.
also check for id?
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.
I agree with this!
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.
I tested nodeId in AccessibilityChannelTest.java
And there is no public api to get id from AccessibilityEvent.
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.
This seems to not be addressed yet
per our offline discussion we talked previously, we can create a mocked event spy on the setSource
camsim99
left a comment
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.
Android part LGTM!
| ArgumentCaptor.forClass(AccessibilityEvent.class); | ||
| verify(mockParent).requestSendAccessibilityEvent(eq(mockRootView), eventCaptor.capture()); | ||
| AccessibilityEvent event = eventCaptor.getAllValues().get(0); | ||
| assertEquals(event.getEventType(), AccessibilityEvent.TYPE_VIEW_FOCUSED); |
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.
I agree with this!
| } | ||
| if ([type isEqualToString:@"focus"]) { | ||
| SemanticsObject* node = objects_.get()[annotatedEvent[@"nodeId"]]; | ||
| ios_delegate_->PostAccessibilityNotification(UIAccessibilityLayoutChangedNotification, node); |
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.
What happens if node is nil? Seems like nil is an OK arg, but just double checking
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.
Tested in my device, if node is nil, nothing will happen, the focus will not be changed
vashworth
left a comment
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.
LGTM
|
Are we blocked on this? |
|
Nope. I think we can land it with @vashworth's stamp |
…127890) flutter/engine@a6d3124...1ba8091 2023-05-30 [email protected] Handle a11y focus event on Ios and android (flutter/engine#41777) 2023-05-30 [email protected] Fix unitialized SkRect (flutter/engine#42403) 2023-05-30 [email protected] Update engine testing to use api 33 for android tests. (flutter/engine#42351) 2023-05-30 [email protected] Reland: "Adding app lifecycle notification for macOS and Linux, add `hidden` state." (#40542) (flutter/engine#42418) 2023-05-30 [email protected] [Impeller] Fixed GlyphAtlasWithLotsOfdUniqueGlyphSize (flutter/engine#42423) 2023-05-30 [email protected] Remove legacy xcode properties/dependencies (flutter/engine#42368) 2023-05-30 [email protected] Roll Skia from bab82f14da1a to fed417995ba9 (7 revisions) (flutter/engine#42424) 2023-05-30 [email protected] [Impeller] removed vulkan unit test csv (flutter/engine#42354) 2023-05-30 [email protected] Roll Skia from d22106cc40a0 to bab82f14da1a (7 revisions) (flutter/engine#42420) If this roll has caused a breakage, revert this CL and stop the roller using the controls here: https://autoroll.skia.org/r/flutter-engine-flutter-autoroll Please CC [email protected],[email protected],[email protected] on the revert to ensure that a human is aware of the problem. To file a bug in Flutter: https://github.com/flutter/flutter/issues/new/choose To report a problem with the AutoRoller itself, please file a bug: https://bugs.chromium.org/p/skia/issues/entry?template=Autoroller+Bug Documentation for the AutoRoller is here: https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
issue: #94523 engine pr: flutter/engine#41777
framework change:flutter/flutter#126171
issue: flutter/flutter#94523
Pre-launch Checklist
///).If you need help, consider asking for advice on the #hackers-new channel on Discord.