Skip to content
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

Add live region semantics flag #5512

Closed
wants to merge 5 commits into from

Conversation

jonahwilliams
Copy link
Member

Discussion: flutter/flutter#18414

@@ -366,6 +367,18 @@ class SemanticsFlag {
/// used to implement accessibility scrolling on iOS.
static const SemanticsFlag isHidden = const SemanticsFlag._(_kIsHiddenIndex);

/// Whether the semantics node represents a region with important screen updates
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: full stop at end?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed

@@ -366,6 +367,18 @@ class SemanticsFlag {
/// used to implement accessibility scrolling on iOS.
static const SemanticsFlag isHidden = const SemanticsFlag._(_kIsHiddenIndex);

/// Whether the semantics node represents a region with important screen updates
///
/// A [SnackBar] is an example of usecase for a live region. Since they are usually
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove "of"?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed

// It is very important that this is added to mLiveRegions before sending the accessibility event
// below.
mLiveRegions.put(object.id, labelHint);
if (priorLabelHint == null || !priorLabelHint.equals(labelHint)) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am a little surprised to see this get send here and not in updateSemantics with the other events. This means, we only send the event if Android actually happens to ask us for the semantics of a particular node, which might not be guaranteed?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree that this is odd. In my experiments I found that (at least on a pixel) no notifications are produced if this event is sent before the framework calls this method. during seems to be no problem

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Did some more investigation and found that there was another error that was masking this. Fixed and moved to a better location

@jonahwilliams jonahwilliams changed the title [WIP] Add live region semantics flag Add live region semantics flag Jun 22, 2018
@@ -366,6 +367,21 @@ class SemanticsFlag {
/// used to implement accessibility scrolling on iOS.
static const SemanticsFlag isHidden = const SemanticsFlag._(_kIsHiddenIndex);

/// Whether the semantics node is a live region.
///
/// A live region indicates that this semantics node will update its
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This sounds misleading to me. Any semantics node may update its semantics label without being a liveRegion, no? liveRegion just tells a11y systems that a it may be relevant to inform the user about a changed label, no?

@jonahwilliams
Copy link
Member Author

Closing in favor of #5601, where I have addressed comments

@jonahwilliams jonahwilliams deleted the live_region branch July 2, 2018 22:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants