Mahdi
01/17/2022, 6:57 AMA [PagingSource] / [PagingData] pair is a snapshot of the data set. A new [PagingData] /
* [PagingData] must be created if an update occurs, such as a reorder, insert, delete, or content
* update occurs. A [PagingSource] must detect that it cannot continue loading its snapshot
* (for instance, when Database query notices a table being invalidated), and call [invalidate].
* Then a new [PagingSource] / [PagingData] pair would be created to represent data from the new
* state of the database query.
1. By creating a new source, adapter data is not clearing well and new items will add to end of last items, then I have to also re create adapter and assyn to recycle view and lots of other headaches.
2. If I go to use invalidate () inside data source, recycler parts works well but I can not bring user back to last point!
In my case my data source get data from net and in some page may previous data is not validate any more( for example items order is changed) and I wanna get data from start, but bring user back to last point! Problem here is if I invalidate() in data source it will start from begining and there is no way to make recycler view scroll to last visible point cause data is not loaded yet!