-
Notifications
You must be signed in to change notification settings - Fork 6k
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
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
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
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!
@@ -362,6 +362,10 @@ static bool DidFlagChange(const flutter::SemanticsNode& oldNode, | |||
NSString* message = annotatedEvent[@"data"][@"message"]; | |||
ios_delegate_->PostAccessibilityNotification(UIAccessibilityAnnouncementNotification, message); | |||
} | |||
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
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 jhy03261997@gmail.com Handle a11y focus event on Ios and android (flutter/engine#41777) 2023-05-30 matej.knopp@gmail.com Fix unitialized SkRect (flutter/engine#42403) 2023-05-30 reidbaker@google.com Update engine testing to use api 33 for android tests. (flutter/engine#42351) 2023-05-30 gspencergoog@users.noreply.github.com Reland: "Adding app lifecycle notification for macOS and Linux, add `hidden` state." (#40542) (flutter/engine#42418) 2023-05-30 30870216+gaaclarke@users.noreply.github.com [Impeller] Fixed GlyphAtlasWithLotsOfdUniqueGlyphSize (flutter/engine#42423) 2023-05-30 54558023+keyonghan@users.noreply.github.com Remove legacy xcode properties/dependencies (flutter/engine#42368) 2023-05-30 skia-flutter-autoroll@skia.org Roll Skia from bab82f14da1a to fed417995ba9 (7 revisions) (flutter/engine#42424) 2023-05-30 30870216+gaaclarke@users.noreply.github.com [Impeller] removed vulkan unit test csv (flutter/engine#42354) 2023-05-30 skia-flutter-autoroll@skia.org 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 jonahwilliams@google.com,rmistry@google.com,zra@google.com 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.