Project Name | Stars | Downloads | Repos Using This | Packages Using This | Most Recent Commit | Total Releases | Latest Release | Open Issues | License | Language |
---|---|---|---|---|---|---|---|---|---|---|
Kotlinx.coroutines | 11,969 | 1,339 | 882 | 3 days ago | 98 | July 13, 2022 | 258 | apache-2.0 | Kotlin | |
Library support for Kotlin coroutines | ||||||||||
Coil | 9,211 | 7 | 5 days ago | 43 | September 08, 2022 | 21 | apache-2.0 | Kotlin | ||
Image loading for Android backed by Kotlin Coroutines. | ||||||||||
Compressor | 6,557 | 9 months ago | 4 | March 22, 2021 | 125 | Kotlin | ||||
An android image compression library. | ||||||||||
Kotlin Coroutines And Flow Usecases On Android | 2,347 | a month ago | 4 | apache-2.0 | Kotlin | |||||
🎓 Learning Kotlin Coroutines and Flows for Android by example. 🚀 Sample implementations for real-world Android use cases. 🛠 Unit tests included! | ||||||||||
Splitties | 2,293 | 1 | 24 days ago | 9 | August 20, 2021 | 48 | apache-2.0 | Kotlin | ||
A collection of hand-crafted extensions for your Kotlin projects. | ||||||||||
Ktx | 1,229 | 2 | 7 hours ago | 32 | May 22, 2022 | 9 | cc0-1.0 | Kotlin | ||
Kotlin extensions for the libGDX game framework | ||||||||||
Paperplane | 1,135 | 5 years ago | 3 | apache-2.0 | Kotlin | |||||
📚 PaperPlane - An Android reading app, including articles from Zhihu Daily, Guokr Handpick and Douban Moment. | ||||||||||
Flowbinding | 875 | 13 | 3 months ago | 20 | July 04, 2021 | 6 | apache-2.0 | Kotlin | ||
Kotlin Coroutines Flow binding APIs for Android's platform and unbundled UI widgets, inspired by RxBinding. | ||||||||||
Kotlin Coroutines Retrofit | 768 | 26 | 3 years ago | 20 | February 11, 2019 | 3 | apache-2.0 | Kotlin | ||
Kotlin Coroutines await() extension for Retrofit Call | ||||||||||
Kord | 718 | 12 days ago | 18 | July 10, 2022 | 41 | mit | Kotlin | |||
Idiomatic Kotlin Wrapper for The Discord API |
An image loading library for Android backed by Kotlin Coroutines. Coil is:
Coil is an acronym for: Coroutine Image Loader.
Translations: , , Trke,
Coil is available on mavenCentral()
.
implementation("io.coil-kt:coil:2.4.0")
To load an image into an ImageView
, use the load
extension function:
// URL
imageView.load("https://example.com/image.jpg")
// File
imageView.load(File("/path/to/image.jpg"))
// And more...
Requests can be configured with an optional trailing lambda:
imageView.load("https://example.com/image.jpg") {
crossfade(true)
placeholder(R.drawable.image)
transformations(CircleCropTransformation())
}
Import the Jetpack Compose extension library:
implementation("io.coil-kt:coil-compose:2.4.0")
To load an image, use the AsyncImage
composable:
AsyncImage(
model = "https://example.com/image.jpg",
contentDescription = null,
)
Both imageView.load
and AsyncImage
use the singleton ImageLoader
to execute image requests. The singleton ImageLoader
can be accessed using a Context
extension function:
val imageLoader = context.imageLoader
ImageLoader
s are designed to be shareable and are most efficient when you create a single instance and share it throughout your app. That said, you can also create your own ImageLoader
instance(s):
val imageLoader = ImageLoader(context)
If you do not want the singleton ImageLoader
, depend on io.coil-kt:coil-base
instead of io.coil-kt:coil
.
To load an image into a custom target, enqueue
an ImageRequest
:
val request = ImageRequest.Builder(context)
.data("https://example.com/image.jpg")
.target { drawable ->
// Handle the result.
}
.build()
val disposable = imageLoader.enqueue(request)
To load an image imperatively, execute
an ImageRequest
:
val request = ImageRequest.Builder(context)
.data("https://example.com/image.jpg")
.build()
val drawable = imageLoader.execute(request).drawable
Check out Coil's full documentation here.
Coil is fully compatible with R8 out of the box and doesn't require adding any extra rules.
If you use Proguard, you may need to add rules for Coroutines, OkHttp and Okio.
Copyright 2023 Coil Contributors
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
https://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.