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.
@Composable fun DrawDrawable() { val drawable = AppCompatResources.getDrawable(LocalContext.current, R.drawable.rectangle) Image( painter = rememberDrawablePainter(drawable = drawable), contentDescription = "content description", ) }
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.