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

[a11y] avoid TYPE_WINDOW_STATE_CHANGED to announce tooltips #86577

Closed
goderbauer opened this issue Jul 16, 2021 · 12 comments · Fixed by #87684
Closed

[a11y] avoid TYPE_WINDOW_STATE_CHANGED to announce tooltips #86577

goderbauer opened this issue Jul 16, 2021 · 12 comments · Fixed by #87684
Assignees
Labels
a: accessibility Accessibility, e.g. VoiceOver or TalkBack. (aka a11y) dependency: android Android team may need to help us engine flutter/engine repository. See also e: labels. P1 High-priority issues at the top of the work list

Comments

@goderbauer
Copy link
Member

goderbauer commented Jul 16, 2021

See https://github.com/flutter/engine/blob/eaf70ca01903d25f2cd7aad2f0f9ce754e1e0e62/shell/platform/android/io/flutter/view/AccessibilityBridge.java#L268-L273.

As of Android 11 newer versions of TalkBack may not announce the message provided to the TYPE_WINDOW_STATE_CHANGED event. The alternative way for announcing tooltips is TBD. We may have to look at the Android source to see how the a11y for the native tooltip works or reverse-engineer the right way from TalkBack's debug logs when activating a native tooltip.

@goderbauer
Copy link
Member Author

@goderbauer goderbauer added a: accessibility Accessibility, e.g. VoiceOver or TalkBack. (aka a11y) dependency: android Android team may need to help us engine flutter/engine repository. See also e: labels. labels Jul 16, 2021
@goderbauer goderbauer changed the title [a11y] don't use TYPE_WINDOW_STATE_CHANGED to announce tooltips [a11y] avoid TYPE_WINDOW_STATE_CHANGED to announce tooltips Jul 16, 2021
@goderbauer
Copy link
Member Author

Related: #86575

@goderbauer
Copy link
Member Author

/cc @chunhtai @blasten

@goderbauer
Copy link
Member Author

(Might also be worthwhile to check weather native tooltips still get announced at all on the latest Android/TalkBack version)

@goderbauer
Copy link
Member Author

I got some more information on this:

  • Tooltips should not dispatch a TYPE_WINDOW_STATE_CHANGED event
  • TalkBack is not expected to read out tooltips when they show up on screen
  • setTooltipText is to be used to tell a11y systems about Tooltips.

@chunhtai chunhtai added the P1 High-priority issues at the top of the work list label Jul 16, 2021
@blasten
Copy link

blasten commented Jul 17, 2021

Thanks @goderbauer.

Tooltips should not dispatch a TYPE_WINDOW_STATE_CHANGED event

do you happen to know if this is a new behavior or is this also true prior to S?

@blasten
Copy link

blasten commented Jul 17, 2021

I searched a bit. It appears that this is a workaround that offered backward compatibility below < 26. Since tooltips were introduced in 26.

28 added setTooltipText, which is what we should be using.

@chunhtai
Copy link
Contributor

chunhtai commented Aug 2, 2021

The tooltip pop up is no longer announced in latest android, do we still need to use setTooltipText? It is also not clear to me when we should setToolTip for the accessibility node info, we can't attach the tooltip to the a11ynodeinfo unless the system ask for the specific node.

@chunhtai
Copy link
Contributor

chunhtai commented Aug 3, 2021

Ok so the tooltip will get appended to the end of focus announcement when the node receive the a11y focus in native android app. Seems like we should do the same

@chunhtai
Copy link
Contributor

chunhtai commented Aug 9, 2021

tooltip repro

import 'package:flutter/material.dart';

void main() => runApp(MyApp());

class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Testing nested talkback app',
      theme: ThemeData(
        primaryColor: Colors.white,
      ),
      home: HomePage(),
    );
  }
}

class HomePage extends StatelessWidget {

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: Text('Testing'),
      ),
      body: Tooltip(message: 'my tool tip', child: Text('text'),),
    );
  }
}

@chunhtai
Copy link
Contributor

The last pr is abandoned due to I am busy with other high prioirty issue
#87684
will get back to it once I have time

@github-actions
Copy link

github-actions bot commented May 5, 2022

This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of flutter doctor -v and a minimal reproduction of the issue.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 5, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
a: accessibility Accessibility, e.g. VoiceOver or TalkBack. (aka a11y) dependency: android Android team may need to help us engine flutter/engine repository. See also e: labels. P1 High-priority issues at the top of the work list
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants