Skip to content
This repository has been archived by the owner on Jul 16, 2024. It is now read-only.

No need to expose Disposable #67

Merged
merged 1 commit into from
Mar 23, 2022
Merged

No need to expose Disposable #67

merged 1 commit into from
Mar 23, 2022

Conversation

Goooler
Copy link
Owner

@Goooler Goooler commented Mar 23, 2022

No description provided.

@Goooler Goooler added this to the 1.6.0 milestone Mar 23, 2022
Comment on lines +107 to +114
) {
loadAny(data) {
placeholder(placeholderDrawable)
error(errorDrawable)
if (cornerRadius > 0) transformations(RoundedCornersTransformation(cornerRadius.toFloat()))
loadWithCache(useCache)
builder()
}
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just impl Coil in common module now, can't access Disposable in other submodules.

implementation(libs.bundles.coil)

@Goooler Goooler merged commit f484704 into trunk Mar 23, 2022
@Goooler Goooler deleted the coil branch March 23, 2022 06:56
@Goooler Goooler changed the title Cleanup ImageLoader No need to expose Disposable Mar 23, 2022
@Goooler
Copy link
Owner Author

Goooler commented Mar 23, 2022

@JvmSynthetic
inline fun ImageView.loadAny(
    data: Any?,
    imageLoader: ImageLoader = context.imageLoader,
    builder: ImageRequest.Builder.() -> Unit = {}
): Disposable {
    val request = ImageRequest.Builder(context)
        .data(data)
        .target(this)
        .apply(builder)
        .build()
    return imageLoader.enqueue(request)
}

https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.jvm/-jvm-synthetic/

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant