-
-
Notifications
You must be signed in to change notification settings - Fork 108
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
[Glide] Add Gif support with GlideImage #173
Comments
Hey @jaredsburrows, |
Since version GlideImage(
imageModel = { poster.gif },
glideRequestType = GlideRequestType.DRAWABLE,
previewPlaceholder = R.drawable.poster
) GlideRequestType supports three different request types:
Thanks! |
@skydoves Thanks. I have tried the following but the gifs are not animating: val glide = Glide.with(LocalView.current)
.asGif()
.override(135.dp.value.roundToInt())
.signature(ObjectKey(item.tinyGifPreviewUrl))
CompositionLocalProvider(LocalGlideRequestBuilder provides glide) {
GlideImage(
imageModel = { item.tinyGifPreviewUrl },
glideRequestType = GlideRequestType.GIF,
modifier = Modifier
.padding(1.dp)
.size(135.dp),
imageOptions = ImageOptions(contentScale = ContentScale.Crop),
loading = {
Box(modifier = Modifier.matchParentSize()) {
CircularProgressIndicator(
modifier = Modifier.align(Alignment.Center)
)
}
},
)
} |
@jaredsburrows GlideImage(
imageModel = { "https://media.giphy.com/media/WNur0b03KntlK/giphy.gif" },
modifier = Modifier
.height(500.dp)
.padding(8.dp)
.clip(RoundedCornerShape(8.dp)),
previewPlaceholder = R.drawable.poster
) |
The example below works well for me 🤔 val glide = Glide.with(LocalView.current)
.asGif()
.override(135.dp.value.roundToInt())
.signature(ObjectKey("https://media.giphy.com/media/WNur0b03KntlK/giphy.gif"))
CompositionLocalProvider(LocalGlideRequestBuilder provides glide) {
GlideImage(
imageModel = { "https://media.giphy.com/media/WNur0b03KntlK/giphy.gif" },
glideRequestType = GlideRequestType.GIF,
modifier = Modifier
.padding(1.dp)
.size(135.dp),
imageOptions = ImageOptions(contentScale = ContentScale.Crop),
loading = {
Box(modifier = Modifier.matchParentSize()) {
CircularProgressIndicator(
modifier = Modifier.align(Alignment.Center)
)
}
},
)
} |
@skydoves Thanks. I got it working. I appreciate the update. |
The
LocalGlideProvider
only supportsDrawable?
:By changing this to support
GifDrawable?
, we can support Glide's.asGif()
:Can we provide a
LocalGlideGifProvider
,LocalGlideBitmapProvider
andLocalGlideDrawableProvider
providers?The text was updated successfully, but these errors were encountered: