-
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
Images displayed incorrectly in views Recycled in Recycler View #710
Comments
Few things that I noticed while reading your question: Clearing image
is pointless, public void setImageDrawable(Drawable drawable) {
if (mDrawable != drawable) {
mResource = 0;
mUri = null; Clearing the ImageView yourself may confuse Glide, it's suggested that you do Loading into
|
Hopefully my comment helped resolve your issue, please reopen if you have questions about the above. |
Hi, apologies for not replying sooner. Thank you for your suggestions, I have streamlined my Glide calls now thanks to your help. I implemented the Glide.clear(imageview) which on it's own didn't work and then I saw you had mentioned the aspect ratio of the placeholder image. The place holder image was just a temporary image I pulled from the internet until our designers created the correct placeholder. I removed the set place holder image method and combined with the Glide.clear(imageview) it works well. The problem is that this is a type of a news feed, so the images that are going to be displayed will be different orientation and sizes. For our designers creating the place holder image is there an optimum ration etc? |
I asked about ratio because of #363. I guess you can double check if you're affected by this by setting a weird placeholder (50x1000 for example). The workaround for the issue is Some people here mentioned they used 9-patches as placeholders, maybe that's the right answer for this kind of use case, I didn't test it myself yet. |
There is one thing I can't explain yet: the padding around the image. The changing ratio (1.333->1.385) is explained by #363, but I'm not sure why it also gets smaller. I guess that's where the messing around with |
Hi
I am displaying images in a recyclerview via Glide. The images are different widths and heights and are being pulled from the server.
The images all display fine until the views begin to be recycled. The image view has
android:layout_width="wrap_content" android:layout_height="wrap_content"
I have tried to sort this by settingholder.getImageView().setImageDrawable(null);
in ` public void onBindViewHolder'. This didn't work. I have found item public void #388 and as that poster had a custom image view you suggested using ViewTarget and delaying size determination. As I'm using a standard ImageView the ImageViewTarget doesn't have a get size method so Im not sure how to apply this to my caseIf you could offer any advice..here's my post on SO http://stackoverflow.com/questions/33283493/recyclerview-recycled-viewholder-image-view-wrong-size
Regards,
Gary
The text was updated successfully, but these errors were encountered: