Consider providing Jetpack Compose support
See original GitHub issueThe current state-of-the-art for image loading in Compose apps is the Accompanist library, which provides a Compose wrapper around Coil and Glide APIs. We still use Picasso heavily internally though, so it might make sense to add Compose support directly to Picasso, at least if it’s not too much trouble.
Open questions
I don’t have strong opinions on the API yet, but there are some questions that we need to answer:
- Should we even bother? Or just start using Coil instead? Coil is a great library, it provides (nearly all, and even some more) the features of Picasso, it’s extensible, etc. There’s also Kamel which even supports Kotlin multiplatform.
- Assuming we want to support it, should it ship as part of the core Picasso artifact or a separate, compose-specific support artifact?
- Some of the Picasso APIs expose drawables. Drawables are not support in Compose, so how should the Compose integration handle them?
- The simplest thing to do would probably be just host an Android View inside the composition to render drawables.
- Accompanist actually provides an internal-only implementation that even supports animated drawables. Not sure we want to maintain that much code.
- How much of the existing API should be reused? E.g. should we provide a Composable function that takes all the parameters that can be configured on a
RequestCreator
, or some way to just provide aRequestCreator
to the composable? SinceRequestCreator
is a mutable, non-compose-stable type, we can’t just pass aRequestCreator
instance to a composable function. - Should we provide
error
/placeholder
overloads that take composable functions? - Should the composable require an explicit
Picasso
instance to be passed in, or should we allow one to be provided through aCompositionLocal
? This question might not matter depending on the answer to (4).
There are probably more questions to be asked, feel free to edit this description or add them in the comments.
Issue Analytics
- State:
- Created 2 years ago
- Reactions:2
- Comments:6 (2 by maintainers)
Top Results From Across the Web
Thinking in Compose | Jetpack Compose - Android Developers
Jetpack Compose is a modern declarative UI Toolkit for Android. Compose makes it easier to write and maintain your app UI by providing...
Read more >Introducing Jetpack Compose Support - PSPDFKit
Like Compose itself, our support for the framework is rather initial, but we're more than happy to be providing built-in APIs for what...
Read more >Frequently Asked Questions about Jetpack Compose
What's the current status of Jetpack Compose? · Can I start using Jetpack Compose in production apps · Will Fragments be deprecated once...
Read more >Jetpack Compose Support in Workflow | Square Corner Blog
To make this easier, we provide a composable function as an extension on ViewFactory that takes a rendering object for that factory and...
Read more >What's new in Jetpack Compose - Android Developers Blog
So, if you're starting a new app, it's time to write it with Compose! With Material Design 3 support, new Bill Of Materials,...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Nobody works on Picasso. If you want something in the next N years definitely use Coil. Or Glide. Or whatever. They’re all fine.
Image loading is a terrible, horrible business to be in. It’s been really nice not being in that business for the last few years. I don’t see a reason to resume. I certainly have no intent to support it anymore. Picasso accomplished its goal of moving the ecosystem out of the painful image loaders of 2011/2012 to the fluent and extensible ones we know today. But it’s filled with technical debt and the legacy of poor design (at least, in hindsight) and is currently very, very stuck between a major refactor and redesign with no end in sight.
Sure. I mean nobody wants to write that because no one intends to let a library languish. But really Picasso is in a stable state. It is not abandoned or archived. Tens of thousands of apps rely on it in production and if something serious comes up it will be looked at. It’s just not undergoing active development.