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.

FountainRx.createNetworkListing(
  networkDataSourceAdapter: RxNetworkDataSourceAdapter<out ListResponse<NetworkValue>>,
  firstPage: Int = FountainConstants.DEFAULT_FIRST_PAGE,
  ioServiceScheduler: Scheduler = Schedulers.io(),
  pagedListConfig: PagedList.Config = FountainConstants.DEFAULT_PAGED_LIST_CONFIG
)

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:

Network Support Listing Creator for not paged endpoints

A Listing with Network support for not paged endpoints can be created invoking createNetworkListing.

FountainRx.createNotPagedNetworkListing(
  notPagedRxPageFetcher: NotPagedRxPageFetcher<out ListResponse<NetworkValue>>,
  ioServiceScheduler: Scheduler = Schedulers.io()
)

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:

Cache + Network Support Listing Creator for paged endpoints

A Listing with Cache + Network Support for paged endpoints can be created invoking the createNetworkWithCacheSupportListing

FountainRx.createNetworkWithCacheSupportListing(
  networkDataSourceAdapter: RxNetworkDataSourceAdapter<out ListResponse<out NetworkValue>>,
  cachedDataSourceAdapter: CachedDataSourceAdapter<NetworkValue, DataSourceValue>,
  ioServiceScheduler: Scheduler = Schedulers.io(),
  ioDatabaseScheduler: Scheduler = FountainConstants.DATABASE_EXECUTOR.toScheduler(),
  firstPage: Int = FountainConstants.DEFAULT_FIRST_PAGE,
  pagedListConfig: PagedList.Config = FountainConstants.DEFAULT_PAGED_LIST_CONFIG
)

There are two required components:

  1. A CachedDataSourceAdapter<Value> to take control of the DataSource.

In addition, there are some optional parameters that you can define:

Cache + Network Support Listing Creator for paged endpoints

A Listing with Cache + Network Support for not paged endpoints can be created invoking the createNetworkWithCacheSupportListing

FountainRx.createNotPagedNetworkWithCacheSupportListing(
  notPagedRxPageFetcher: NotPagedRxPageFetcher<out ListResponse<out NetworkValue>>,
  cachedDataSourceAdapter: CachedDataSourceAdapter<NetworkValue, DataSourceValue>,
  ioServiceScheduler: Scheduler = Schedulers.io(),
  ioDatabaseScheduler: Scheduler = FountainConstants.DATABASE_EXECUTOR.toScheduler()
)

There are two required components:

  1. A CachedDataSourceAdapter<Value> to take control of the DataSource.

In addition, there are some optional parameters that you can define:

Last updated