Skip to content

Drawable Painter

Maven Central

A library which provides a way to use Android drawables as Jetpack Compose Painters.

This library attempts to support most Drawable configuration, as well as Animatable drawables, such as AnimatedVectorDrawable.

Usage

@Composable
fun DrawDrawable() {
    val drawable = AppCompatResources.getDrawable(LocalContext.current, R.drawable.rectangle)

    Image(
        painter = rememberDrawablePainter(drawable = drawable),
        contentDescription = "content description",
    )
}

Download

Maven Central

repositories {
    mavenCentral()
}

dependencies {
    implementation "com.google.accompanist:accompanist-drawablepainter:<version>"
}

Snapshots of the development version are available in Sonatype's snapshots repository. These are updated on every commit.