Drawable Painter
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
repositories { mavenCentral() } dependencies { implementation "com.google.accompanist:accompanist-drawablepainter:<version>" }
标签:Compose,Jetpack,drawables,library,Drawable,drawable From: https://www.cnblogs.com/letleon/p/17017168.html