简体   繁体   English

焦点切换到 FireTv 应用程序嵌套回收视图中的下一行

[英]Focus switching to next row in nested recyclerview in FireTv App

In our fire tv app, we are using a nested recyclerview where every vertical item have a horizontal row as a child item like playstore design .在我们的 fire tv 应用程序中,我们使用了一个嵌套的 recyclerview,其中每个垂直项目都有一个水平行作为子项目,如Playstore 设计

Scrolling with dpad working fine normally but when i hold the right key for few seconds, item start scrolling very fast because it gets many events & within few second focus goes to the next random row even current row has items to scroll.使用 dpad 滚动正常工作,但是当我按住右键几秒钟时,项目开始滚动得非常快,因为它有很多事件,并且在几秒钟内焦点转到下一个随机行,即使当前行有项目要滚动。 So this whole problem happening in horizontal scroll(child recyclerview).所以这整个问题发生在水平滚动(子回收视图)中。 I have already tried many solutions like this , this , this .我已经尝试了多种解决方案,如这个这个这个

Also tried the custom layout manager, custom focus layout & other approach like slowing down the recyclerview scroll etc approach but all not working.还尝试了自定义布局管理器、自定义焦点布局和其他方法,例如减慢 recyclerview 滚动速度等方法,但都不起作用。

As far as I know, this happens at the moment when the last item is in focus, and the next item is not visible, that is, the ViewHolder has not updated the data of the first cell, so it is not clear which element to show next as if the list has ended.据我所知,这种情况发生在最后一项获得焦点,而下一项不可见的那一刻,即ViewHolder还没有更新第一个单元格的数据,所以不清楚是哪个元素显示 next 就好像列表已经结束一样。

You need to make sure that at least the edge of the next element is always visible on the screen.您需要确保至少下一个元素的边缘在屏幕上始终可见。

Maybe you should play with the cell size or divider.也许您应该使用单元格大小或分隔符。

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

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