Hello all. Any one have any idea if there are pla...
# android
b
Hello all. Any one have any idea if there are plans in the paging 3 library to support sorting. I have a use case where I would like to sort items based on how far away from my current location they are.
😶 1
f
wouldn't that defeat the purpose of paging? you would have to load the items to know how far away they are (not clear what "far away" means in this context though), but if you need the item to sort it, then you are not getting any benefits from paging as you would have to load the whole set at once
seems like something that would be better of done at the backend, you tell the backend which kind of sorting you need and then you page the response
👍🏻 1
b
Sorting on the backend is not possible. Closest means closest to the users current location. All DB objects have a latitude/longitude, I would want to sort based on a distance calculation between the users current location and the location of each object in the database.