Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for bitmap or drawable in Android target #46

Open
klusi opened this issue Jun 27, 2023 · 2 comments
Open

Support for bitmap or drawable in Android target #46

klusi opened this issue Jun 27, 2023 · 2 comments

Comments

@klusi
Copy link

klusi commented Jun 27, 2023

Would it be possible to provide a Bitmap or Drawable in addition to Painter when the image is successfully downloaded in Android target similar to Coil-Compose?
Coil:

DisposableEffect(url) {
    val request = ImageRequest.Builder(context)
        .data(data = url)
        .target { drawable ->
            val bitmap = drawable.toBitmapOrNull() ?: return@target
            // TODO use bitmap
        }
        .build()

    val disposable = ImageLoader.Builder(context)
        .components { add(SvgDecoder.Factory()) }
        .build()
        .enqueue(request)

    onDispose {
        disposable.dispose()
    }
}
@luca992
Copy link
Member

luca992 commented Jun 27, 2023

So you want to load a svg as a placeholder before loading a bitmap?

@klusi
Copy link
Author

klusi commented Jun 30, 2023

No, I would like to download svg and get a Bitmap or Drawable in addition to Painter as a result. There are still few Compose components (for example Google Maps Markers) that required bitmap instead of Painter and I don't want to use different library for it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants