-
Notifications
You must be signed in to change notification settings - Fork 6.1k
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
Issue when trying to load thumbnails from URL #1198
Comments
The code on https://futurestud.io/blog/glide-thumbnails works fine, but as soon as you start adding new things, especially Glide uses the builder pattern to make a fluid easily changeable API to set up the load request. This is done via
The unchecked assignment is just a warning, but usually signifies you are doing something weird that may break at runtime. In this case since you cast or otherwise lost the generic argument of
Yep, it came up a lot and I fixed it now in #1096, but it's not released yet, you can get
That's not available as a convenience method, because most of the time you'll want to customize other things too. The Glide
.with(context)
.load(url)
.asBitmap() // -----------------------------------------
.crossFade() // |
.thumbnail(Glide // |
.with(context) // |
.load(thumbnailURL) // |
.asBitmap() // necessary to match the builder type <
// .fitCenter|centerCrop() // may need to specify what transform you want
)
//.fitCenter|centerCrop() // implicitly added if you use `into(ImageView)`, see source of that method
.into(imageView)
; |
Thank you so much, using this now, which worked fine: Glide.with(context)
.load(url)
.asBitmap()
.crossFade()
.thumbnail(
Glide.with(context)
.load(thumbnailURL)
.asBitmap()
.crossFade()
.thumbnail(0.5f)
)
.into(imageView); |
That loads |
Glide Version: 3.7.1
Integration libraries: None
Device/Android Version: Moto G Second Gen (Titan) - Android 6.0.1
I'm trying to use the code in your website (screenshot) to load a thumbnail using a String url.
When using this code, I get an error in Android Studio saying:
Cannot resolve method 'thumbnail(com.bumptech.glid.DrawableRequestBuilder<java.lang.String>)'
I saw another option in a website which was:
But now I get:
What can I do to fix these issues? What can I use to use a String as thumbnail?
Additionally, I wanted to report, that I can't define
.crossFade()
before.asBitmap()
, neither after it.Basically, what I expect to be able to do is something like:
I hope to get some help soon. Thank you. :) And thanks for the awesome library.
The text was updated successfully, but these errors were encountered: