简体   繁体   English

Android对讲; 如何禁用宣布单元格 position 和单元格计数?

[英]Android talkback; how to disable announcing cell position and cell count?

When I have a recycler view with 12 items, when accessibility focus goes onto cell number 3, for example, talkback announces "Double tap to activate. Item 3 of 12".例如,当我有一个包含 12 个项目的回收站视图时,当可访问性焦点转到单元格 3 时,对讲会宣布“双击激活。项目 3 of 12”。

I want to keep the action but stop it from announcing the item position and item count.我想保持行动,但阻止它宣布项目 position 和项目计数。 How can I do this?我怎样才能做到这一点? I have tried to assign a delegate to the recycler view but not sure what to override in the delegate.我试图将委托分配给回收站视图,但不确定要在委托中覆盖什么。

How can I do this?我怎样才能做到这一点?

This is a functionality that should not be disabled: it lets people using Talkback know that they are in a list, how long is the list, which element is currently focused (are there more elements above/below).这是一个不应该被禁用的功能:它让使用 Talkback 的人知道他们在一个列表中,列表有多长,当前关注哪个元素(上面/下面是否有更多元素)。

So I figured it out.所以我想通了。 An AccessibilityNodeInfo has a method called SetCollectionInfo() . AccessibilityNodeInfo 有一个名为SetCollectionInfo()的方法。 CollectionInfo has properties like rowCont and columnCount. CollectionInfo 具有 rowCont 和 columnCount 等属性。 I simply set the info to null.我只是将信息设置为 null。

Note, the below is xamarin:注意,下面是 xamarin:

    private class TabLayoutTabAccessibilityDelegate: View.AccessibilityDelegate
    {
        public override void OnInitializeAccessibilityNodeInfo(View host, AccessibilityNodeInfo info)
        {
            base.OnInitializeAccessibilityNodeInfo(host, info);
            info.SetCollectionInfo(null);
        }
    }

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM