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 placeholder attribute for ZoomableAsyncImage #28

Open
minas1 opened this issue Jun 6, 2023 · 3 comments
Open

Support placeholder attribute for ZoomableAsyncImage #28

minas1 opened this issue Jun 6, 2023 · 3 comments

Comments

@minas1
Copy link

minas1 commented Jun 6, 2023

Coil's AsyncImage has a placeholder attribute: placeholder: Painter? = null.

Please add support for it in ZoomableAsyncImage.


In the docs there's mention of using placeholders using placeholderMemoryCacheKey() but in Coil's website this is used for regular views, not Compose. And even if it can be used with Compose it would be much easier to support the placeholder attribute directly.

@saket
Copy link
Owner

saket commented Jun 6, 2023

Good point, let's add parameters for placeholder, error and fallback. Wanna send a PR?

@MV-GH
Copy link

MV-GH commented Aug 1, 2023

You can get all these already by setting them on the imageLoader and the ImageRequest

@saket
Copy link
Owner

saket commented Aug 2, 2023

Yea you can indeed set placeholders through ImageRequest.Builder but it only accepts drawables and resources. You can't use painters through telephoto yet.

@minas1 fwiw placeholderMemoryCacheKey is different from placeholder. It is useful for creating shared element transitions by using a previously loaded image in lower quality as the placeholder for loading a larger resolution variant.

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

3 participants