有没有办法使用 PagingDataAdapter 查找项目并滚动到该视图?

yao*_*yao 4 android kotlin android-viewholder android-recyclerview android-paging

我正在使用 Android Paging Library 3. 有没有办法使用 PagingDataAdapter 查找项目并滚动到该视图?因为我无法访问项目列表。或者我别无选择,只能使用普通的列表适配器?

dla*_*lam 5

下一个版本的分页 (3.0.0-alpha04) 将添加.peek(index).snapshot()API 以允许呈现的项目访问加载数据的转换后。

与此同时,解决方法是使用,PagingDataAdapter.getItem()但这是次优的,因为它会触发页面提取。