← ClaudeAtlas

compose-imageslisted

Images in Compose per Google's image docs and Coil 3: painterResource vs AsyncImage, dependencies, sizing and downsampling, lists, painter state, the ImageLoader with OkHttp and caching, previews, tests. Use when loading network, file or resource images, and when URLs never load, images use too much memory, lists jump as images arrive, or previews show no image.
pablitoarango/android-skills · ★ 3 · AI & Automation · score 74
Install: claude install-skill pablitoarango/android-skills
# Loading Images in Compose Sources of truth: [Loading images](https://developer.android.com/develop/ui/compose/graphics/images/loading), [Optimizing bitmap images](https://developer.android.com/develop/ui/compose/graphics/images/optimization), [Lists and grids](https://developer.android.com/develop/ui/compose/lists), and Coil's [Getting started](https://coil-kt.github.io/coil/getting_started/), [Compose](https://coil-kt.github.io/coil/compose/), [Image loaders](https://coil-kt.github.io/coil/image_loaders/), [Network images](https://coil-kt.github.io/coil/network/), [Testing](https://coil-kt.github.io/coil/testing/) and [Upgrading to Coil 3](https://coil-kt.github.io/coil/upgrading_to_coil3/) pages. Related skills: `compose-lists`, `compose-performance`, `compose-accessibility`, `compose-testing`, `android-retrofit` (the shared OkHttp client). ## 1. Pick the API | Image source | API | |---|---| | App resource: vector drawable, PNG, JPEG, WebP | `Image(painter = painterResource(R.drawable.x), contentDescription = ...)`, or `Icon(...)` for tinted icons | | URL, file, content URI, anything that must be fetched or decoded off the main thread | An image loading library. Google names Coil for Kotlin-first projects and Glide for Java projects; this skill uses Coil 3 | Image libraries cache in memory and on disk, downsample to the target size, and cancel work that leaves the screen. Do not decode bitmaps by hand in composables. ## 2. Dependencies Coil 3 lives under the `io.co