Skip to content

Instantly share code, notes, and snippets.

@skydoves
Created March 28, 2026 01:14
Show Gist options
  • Select an option

  • Save skydoves/57870b924ff8ab01df204cc0aa37a230 to your computer and use it in GitHub Desktop.

Select an option

Save skydoves/57870b924ff8ab01df204cc0aa37a230 to your computer and use it in GitHub Desktop.
ImagePlugin sealed interface - PainterPlugin and LoadingStatePlugin
@Immutable
public sealed interface ImagePlugin {
public interface PainterPlugin : ImagePlugin {
@Composable
public fun compose(imageBitmap: ImageBitmap, painter: Painter): Painter
}
public interface LoadingStatePlugin : ImagePlugin {
@Composable
public fun compose(
modifier: Modifier,
imageOptions: ImageOptions,
executor: @Composable (IntSize) -> Unit,
): ImagePlugin
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment