Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there a way to find item and scroll to that viewholder using PagingDataAdapter?

I'm using Android Paging Library 3. Is there a way to find item and scroll to that viewholder using PagingDataAdapter? As I'm not able to access the item list. Or I have no choice but have to use normal list adapter?

like image 374
yao Avatar asked Aug 04 '20 03:08

yao


1 Answers

The next version of paging (3.0.0-alpha04) will add .peek(index) and .snapshot() APIs to allow presented item access post-transformations of loaded data.

In the meantime the workaround is to use PagingDataAdapter.getItem() but this is suboptimal because it triggers page fetch.

like image 181
dlam Avatar answered Sep 19 '22 23:09

dlam