/** A builder for load images with DSL */ @ImageLoaderDsl class Builder @PublishedApi internal constructor() { /** * REQUIRED * The image to load into [target] * * It supports both sync and async source. * @see ImageLoader */ lateinit var image: Any /** The [ImageView] where to load the [image]. REQUIRED */ lateinit var target: ImageView /** * The image to load as placeholder for async request. * It will be ignored for *successful* non-web requests, but it will be used anyway if there is an * error loading [image] and no [error] is supplied * * It supports *only sync* sources * @see ImageLoader */ var placeHolder: Any? = null /** * The image to load if some error occurred while loading [image] * * It supports both sync and async source. For async sources it makes sense to provide a ( sync ) * [placeHolder] * @see ImageLoader */ var error: Any? = null /** The [Shape] to apply to [image] */ var shape = defaultShape /** @return [RequestParams] */ fun build() = RequestParams( image = image, target = target, placeHolder = placeHolder, error = error ?: placeHolder, shape = shape ) }