Join Slack
Powered by
Hi, hope this is not a dump question Can jetpack c...
# compose
e
elye
04/28/2024, 3:18 AM
Hi, hope this is not a dump question Can jetpack compose preview takes in URL to display an image (from URL) e.g.
https://stackoverflow.com/questions/75525585/compose-preview-with-coil-image-from-url
. Or there is no point sending a URL for Jetpack Compose Preview? Thanks!!
d
Doug McCluer
04/28/2024, 3:17 PM
The compose preview in Android Studio does not have network access, as far as I know, so displaying remote URLs in the Preview window doesn't work. For preview functions, you can pass a local drawable to the Composable, or set the `placeholder`/`fallback`properties in Coil
https://tedblob.com/jetpack-compose-coil-placeholder/
https://stackoverflow.com/questions/77957402/how-to-preview-the-image-by-uri-in-android-jetpack-compose
l
Lucca Beurmann
04/29/2024, 12:19 AM
I don't think it's possible to do that, but if i remember correctly there is a way to display mocked content for the previews
Open in Slack
Previous
Next