Skip to content

Instantly share code, notes, and snippets.

@frel
Created August 15, 2021 10:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save frel/2f486804269e107c4cde185f7ecfafb6 to your computer and use it in GitHub Desktop.
Save frel/2f486804269e107c4cde185f7ecfafb6 to your computer and use it in GitHub Desktop.
AirBrush Medium article example
class TinyThumbDataFetcher(private val thumb: TinyThumb) : DataFetcher<TinyThumb> {
override fun loadData(
priority: Priority,
callback: DataFetcher.DataCallback<in TinyThumb>
) = callback.onDataReady(thumb)
override fun getDataClass(): Class<TinyThumb> = TinyThumb::class.java
override fun getDataSource(): DataSource = DataSource.LOCAL
override fun cleanup() { /* Do nothing */ }
override fun cancel() { /* Do nothing */ }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment