Skip to content

Instantly share code, notes, and snippets.

@CristianMG
Created June 8, 2019 08:36
Show Gist options
  • Select an option

  • Save CristianMG/bbba4c19d0ecbb4b8bf33061f3c6f8b5 to your computer and use it in GitHub Desktop.

Select an option

Save CristianMG/bbba4c19d0ecbb4b8bf33061f3c6f8b5 to your computer and use it in GitHub Desktop.
Android paging Network + Database 3 snippet
override fun characters(offset: Int, sizePage: Int): Single<List<CharacterEntity>> {
val ts = apiInf.ts
return retrofit.create(NetworkCalls::class.java)
.getCharacters(ts, apiInf.publicApiKey, apiInf.getHash(ts), offset, sizePage,"name")
.subscribeOn(Schedulers.io())
.map { it.getDataOrError().results }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment