Fountain RxJava2 static factory
This module provides a Listing
component based on a Retrofit RxJava2 adapter.
Network Support Listing Creator for paged endpoints
A Listing with Network support for paged endpoints can be created invoking createNetworkListing
.
There's only one required structure, RxNetworkDataSourceAdapter<out ListResponse<Value>>
, which Fountain uses to handle the paging.
In addition, there are some optional parameters that you can define:
firstPage: Int
: The initial page number, by default its value is 1.ioServiceScheduler: Scheduler
: The Scheduler that will be used to make the service call. By default, the library will useSchedulers.io()
.pagedListConfig: PagedList.Config
: The paged list configuration.In this object you can specify several options, for example the
pageSize
and theinitialPageSize
.
Network Support Listing Creator for not paged endpoints
A Listing with Network support for not paged endpoints can be created invoking createNetworkListing
.
There's only one required structure, NotPagedRxPageFetcher<out ListResponse<Value>>
, which Fountain uses to handle the paging.
In addition, there are some optional parameters that you can define:
firstPage: Int
: The initial page number, by default its value is 1.Additionally you can specify the
ioServiceScheduler: Scheduler
. It's the Scheduler that will be used to make the service call. By default, the library will useSchedulers.io()
.
Cache + Network Support Listing Creator for paged endpoints
A Listing with Cache + Network Support for paged endpoints can be created invoking the createNetworkWithCacheSupportListing
There are two required components:
A
RxNetworkDataSourceAdapter<out ListResponse<Value>>
to fetch all pages.A
CachedDataSourceAdapter<Value>
to take control of theDataSource
.
In addition, there are some optional parameters that you can define:
firstPage: Int
: The initial page number, by default its value is 1.ioServiceScheduler: Scheduler
: The Scheduler that will be used to make the service call. By default, the library will useSchedulers.io()
.ioDatabaseScheduler : Scheduler
: The Scheduler through which the database transactions will be made. By default the library will use a single thread Scheduler.pagedListConfig: PagedList.Config
: The paged list configuration.In this object you can specify several options, for example the
pageSize
and theinitialPageSize
.
Cache + Network Support Listing Creator for paged endpoints
A Listing with Cache + Network Support for not paged endpoints can be created invoking the createNetworkWithCacheSupportListing
There are two required components:
A
NotPagedRxPageFetcher<out ListResponse<Value>>
to fetch all pages.A
CachedDataSourceAdapter<Value>
to take control of theDataSource
.
In addition, there are some optional parameters that you can define:
ioServiceScheduler: Scheduler
: The Scheduler that will be used to make the service call. By default, the library will useSchedulers.io()
.ioDatabaseScheduler : Scheduler
: The Scheduler through which the database transactions will be made. By default the library will use a single thread Scheduler.
Last updated