IviPagingSource
Interface for an abstraction of pageable static data from some source, where loading pages of data is typically an expensive operation. Some examples of common PagingSources might be from network or from a database.
This class substitutes the Android's PagingSource class. See PagingSource for details. The IVI service framework uses a substitute to allow the source to be implemented at the service side. Mirroring the PagingSource one to one on the client side is not possible as some of the PagingSource API cannot block on IO. Also to allow the IVI service framework integrate seamlessly with the Android paging library, the construction of the PagingSource class cannot be blocked on IO. For this reason the IviPagingSource class deviates at four points from the PagingSource class:
PagingSource.getRefreshKey is implemented solely on the client side. Therefore not included in the IviPagingSource class.
PagingSource.jumpingSupported is obtained from the IviDataSource instead of the IviPagingSource. Therefore not included in the IviPagingSource class.
PagingSource.keyReuseSupported is obtained from the IviDataSource instead of the IviPagingSource. Therefore not included in the IviPagingSource class.
IviPagingSource does not have a
Key
parameterized type. The IviPagingSource always uses an index to define which data to load. This is required to be able to implement PagingSource.getRefreshKey solely on the client side.
The remainder of the IviPagingSource API mimics the PagingSource class.
Inheritors
Types
Substitutes PagingSource.LoadParams.
Substitutes PagingSource.LoadResult.
Functions
Signal the PagingSource to stop loading. Same as PagingSource.invalidate. See PagingSource.invalidate for details.
Loads a page. Same as PagingSource.load. See PagingSource.load for details.
Registers an invalidated callback. Same as PagingSource.registerInvalidatedCallback. See PagingSource.registerInvalidatedCallback for details.
Unregisters an invalidated callback. Same as PagingSource.unregisterInvalidatedCallback. See PagingSource.unregisterInvalidatedCallback for details.