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

[FR]: Avoid subcomposition on SparkImage when is not necessary #738

Open
2 tasks done
danielriverolosa opened this issue Sep 21, 2023 · 0 comments
Open
2 tasks done
Labels
Bug Bug to fix Component Related to a component

Comments

@danielriverolosa
Copy link

🕵️ Is there an existing issue for this?

  • I have searched the existing issues

Describe the problem

SparkImage uses Coil library inside to display images, specifically the composable SubcomposeAsyncImage, which in itself, depending on a SizeResolver, uses a BoxWithConstraints layout. It can be seen here.
Subcomposition can be avoided building the ImageRequest yourself on the model and applying original size, but it is not documented anywhere in SparkImage and may lead to incorrect uses.

Official Coil documentation recommend not to use this component (SubcomposeAsyncImage) in listings or this kind of similar cases due to performance issues.

Describe the solution

Perhaps it is appropriate to use the component recommended by the documentation in each case or, on the other hand, document correctly what should be the building of the model to avoid the use of the subcomposition and its performance problems.

Additional context

No response

Code of Conduct

  • I agree to follow this project's Code of Conduct
@soulcramer soulcramer added Bug Bug to fix Component Related to a component labels Sep 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Bug to fix Component Related to a component
Projects
None yet
Development

No branches or pull requests

2 participants