ResourcePainterProvider

class ResourcePainterProvider(basePath: String, classLoaders: ClassLoader) : PainterProvider

Provide Painter by resources in the module and jars, it use the ResourceResolver to load resources.

It will cache the painter by PainterHints, so it is safe to call getPainter multiple times.

If a resource fails to load, it will be silently replaced by a magenta color painter, and the exception logged as error.

Constructors

Link copied to clipboard
constructor(basePath: String, vararg classLoaders: ClassLoader)

Functions

Link copied to clipboard
@Composable
open override fun getPainter(vararg hints: PainterHint): State<Painter>

Provides a Painter using the specified PainterHints. The painters are remembered and this function can be called multiple times for the same data.