Created
August 15, 2021 10:41
-
-
Save frel/f83c4216de15da8f317804851836d003 to your computer and use it in GitHub Desktop.
AirBrush Medium article example
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class TinyThumbLoader : ModelLoader<TinyThumb, TinyThumb> { | |
override fun buildLoadData( | |
model: TinyThumb, | |
width: Int, | |
height: Int, | |
options: Options | |
) = ModelLoader.LoadData( | |
ObjectKey(model.toString()), | |
TinyThumbDataFetcher(model) | |
) | |
// Quick check to see if this model can be decoded | |
override fun handles(model: TinyThumb): Boolean = model.base64.isNotEmpty() | |
class Factory : ModelLoaderFactory<TinyThumb, TinyThumb> { | |
override fun build(multiFactory: MultiModelLoaderFactory) = TinyThumbLoader() | |
override fun teardown() { /* Do nothing */ } | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment