I have a method that returns a certain number of records and their total number in json, the answer looks like this:
{ hits:100 ...тут идут переданные записи } In the query parameters, you can specify two parameters limit - the number of records to be transferred and page shift on records to the limit. There can be about 1000 records and it is obviously impossible to load them all at once. I did some semblance of automatic upload, it works like this:
- The first query is made with page 0 and limit 50
- After parsing the answer, look at the hits and make the request again.
- Repeat until goal is reached
I do not like a few moments
- All items are loaded immediately.
- When updating the list, RecyclerView jumps to the first item.
What is the best way to deal with these two problems?