All Projects → coil-kt → Coil

coil-kt / Coil

Licence: apache-2.0
Image loading for Android backed by Kotlin Coroutines.

Programming Languages

kotlin
9241 projects
shell
77523 projects

Projects that are alternatives of or similar to Coil

pixel
A lightweight image loader for Android backed by Kotlin Coroutines.
Stars: ✭ 79 (-98.94%)
Mutual labels:  images, coroutines, okhttp, image-loader, okio, androidx
WanAndroidJetpack
🔥 WanAndroid 客户端,Kotlin + MVVM + Jetpack + Retrofit + Glide。基于 MVVM 架构,用 Jetpack 实现,网络采用 Kotlin 的协程和 Retrofit 配合使用!精美的 UI,便捷突出的功能实现,欢迎下载体验!
Stars: ✭ 124 (-98.34%)
Mutual labels:  coroutines, okhttp, kotlin-coroutines, androidx
korte
Kotlin cORoutines Template Engine for Multiplatform Kotlin
Stars: ✭ 69 (-99.08%)
Mutual labels:  coroutines, kotlin-coroutines
Retrofit2-Flow-Call-Adapter
A Retrofit 2 adapter for Kotlin Flows.
Stars: ✭ 41 (-99.45%)
Mutual labels:  coroutines, kotlin-coroutines
Coffeegram
Android app using Jetpack Compose together with StateFlow and MVI
Stars: ✭ 155 (-97.92%)
Mutual labels:  coroutines, kotlin-coroutines
android-clean-arc-coroutines
Clean Architecture(Coroutines,Dagger, MVVM, ROOM, retrofit, databinding)
Stars: ✭ 116 (-98.45%)
Mutual labels:  coroutines, kotlin-coroutines
BlueFlow
Android Bluetooth classic API wrapped in Coroutines Flow.
Stars: ✭ 64 (-99.14%)
Mutual labels:  coroutines, kotlin-coroutines
fluid-mongo
Kotlin coroutine support for MongoDB built on top of the official Reactive Streams Java Driver
Stars: ✭ 27 (-99.64%)
Mutual labels:  coroutines, kotlin-coroutines
mqtt
Kotlin cross-platform, coroutine based, reflectionless MQTT 3.1.1 & 5.0 client & server
Stars: ✭ 31 (-99.58%)
Mutual labels:  coroutines, kotlin-coroutines
Korio
Korio: Kotlin cORoutines I/O : Virtual File System + Async/Sync Streams + Async TCP Client/Server + WebSockets for Multiplatform Kotlin 1.3
Stars: ✭ 282 (-96.22%)
Mutual labels:  coroutines, kotlin-coroutines
Coroutineworker
Kotlin Coroutine-based workers for native
Stars: ✭ 282 (-96.22%)
Mutual labels:  coroutines, kotlin-coroutines
Corbind
Kotlin Coroutines binding APIs for Android UI widgets from the platform and support libraries
Stars: ✭ 357 (-95.22%)
Mutual labels:  coroutines, kotlin-coroutines
SketchwareManager
Coroutine-based library for managing Sketchware (Sketchware Pro/Studio) projects, collections and etc.
Stars: ✭ 54 (-99.28%)
Mutual labels:  coroutines, kotlin-coroutines
NewsReader
Android News Reader app. Kotlin Coroutines, Retrofit and Realm
Stars: ✭ 21 (-99.72%)
Mutual labels:  coroutines, kotlin-coroutines
AndroidCoroutineScopes
This lib implements the most common CoroutineScopes used in Android apps.
Stars: ✭ 14 (-99.81%)
Mutual labels:  coroutines, kotlin-coroutines
jda-ktx
Collection of useful Kotlin extensions for JDA
Stars: ✭ 49 (-99.34%)
Mutual labels:  coroutines, kotlin-coroutines
Uniflow Kt
Uniflow 🦄 - Simple Unidirectional Data Flow for Android & Kotlin, using Kotlin coroutines and open to functional programming
Stars: ✭ 414 (-94.46%)
Mutual labels:  coroutines, kotlin-coroutines
WanAndroid
wanandroid的Kotlin版,采用Android X
Stars: ✭ 20 (-99.73%)
Mutual labels:  okhttp, androidx
GitMessengerBot-Android
타입스크립트, V8 엔진의 자바스크립트, 파이썬 그리고 Git을 지원하는 최첨단 메신저 봇!
Stars: ✭ 51 (-99.32%)
Mutual labels:  okhttp, kotlin-coroutines
modern-android
Modern Android Project Skeleton
Stars: ✭ 17 (-99.77%)
Mutual labels:  coroutines, androidx

Coil

An image loading library for Android backed by Kotlin Coroutines. Coil is:

  • Fast: Coil performs a number of optimizations including memory and disk caching, downsampling the image in memory, re-using bitmaps, automatically pausing/cancelling requests, and more.
  • Lightweight: Coil adds ~2000 methods to your APK (for apps that already use OkHttp and Coroutines), which is comparable to Picasso and significantly less than Glide and Fresco.
  • Easy to use: Coil's API leverages Kotlin's language features for simplicity and minimal boilerplate.
  • Modern: Coil is Kotlin-first and uses modern libraries including Coroutines, OkHttp, Okio, and AndroidX Lifecycles.

Coil is an acronym for: Coroutine Image Loader.

Made with ❤️ at Instacart. Translations: 한국어, 中文, Türkçe

Download

Coil is available on mavenCentral().

implementation("io.coil-kt:coil:1.4.0")

Quick Start

To load an image into an ImageView, use the load extension function:

// URL
imageView.load("https://www.example.com/image.jpg")

// Resource
imageView.load(R.drawable.image)

// File
imageView.load(File("/path/to/image.jpg"))

// And more...

Requests can be configured with an optional trailing lambda:

imageView.load("https://www.example.com/image.jpg") {
    crossfade(true)
    placeholder(R.drawable.image)
    transformations(CircleCropTransformation())
}

Image Loaders

imageView.load uses the singleton ImageLoader to enqueue an ImageRequest. The singleton ImageLoader can be accessed using an extension function:

val imageLoader = context.imageLoader

Optionally, you can create your own ImageLoader instance(s) and inject them with dependency injection:

val imageLoader = ImageLoader(context)

If you do not want the singleton ImageLoader, depend on io.coil-kt:coil-base.

Requests

To load an image into a custom target, enqueue an ImageRequest:

val request = ImageRequest.Builder(context)
    .data("https://www.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://www.example.com/image.jpg")
    .build()
val drawable = imageLoader.execute(request).drawable

Check out Coil's full documentation here.

Requirements

R8 / Proguard

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.

License

Copyright 2021 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.
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].