gpt4 book ai didi

android - Accessibility Callback - 当 talkback 读完通知时

转载 作者:行者123 更新时间:2023-11-29 02:20:10 25 4
gpt4 key购买 nike

对于一些用户操作,我想在屏幕上做一些公告,不久之后,我想将可访问性焦点转移到特定 View

我可以做到,

 view!!.announceForAccessibility("some action failed.")
Handler().postDelayed({
specificView.requestFocus()
specificView.sendAccessibilityEvent(AccessibilityEvent.TYPE_VIEW_FOCUSED)
}, 1000)

但这只是一种解决方法。在某些情况下,当用户有自定义语速等时,它可能会失败。

Is there any way where we can get a callback when talkback finish with reading announcement?

最佳答案

我不确定这是否是正确的解决方案,但这对我有用。

 specificView.contentDescriotion = "text you need to annonce"
specificView.requestFocus()
specificView.sendAccessibilityEvent(AccessibilityEvent.TYPE_VIEW_FOCUSED)
Handler().postDelayed({
specificView.contentDescriotion = "actual content description for that view"
}, 300)

对您要关注的 View 的内容描述进行公告。

关于android - Accessibility Callback - 当 talkback 读完通知时,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/56667674/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com