Fountain Retrofit static factory
This module provides a Listing
component based on a Retrofit call implementation.
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, RetrofitNetworkDataSourceAdapter<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.ioServiceExecutor : Executor
: The executor that will be used to make the service call. By default, the library will use a pool of 5 threads.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 paged not endpoints can be created invoking createNetworkListing
.
There's only one required structure, NotPagedRetrifitPageFetcher<out ListResponse<Value>>
, which Fountain uses to handle the paging.
Additionally you can specify the ioServiceExecutor : Executor
. It's the executor that'll be used to make the service call.
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
RetrofitNetworkDataSourceAdapter<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.ioServiceExecutor : Executor
: The executor through which the service call will be made By default, the library will use a pool of 5 threads.ioDatabaseExecutor : Executor
: The executor through which the database transactions will be made. By default the library will use a single thread executor.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 not paged endpoints
A Listing with Cache + Network Support for paged endpoints can be created invoking the createNetworkWithCacheSupportListing
There are two required components:
A
NotPagedRetrifitPageFetcher<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:
ioServiceExecutor : Executor
: The executor through which the service call will be made. By default, the library will use a pool of 5 threads.ioDatabaseExecutor : Executor
: The executor through which the database transactions will be made. By default the library will use a single thread executor.
Last updated