-
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
Placeholder is displayed in RecyclerView, but after refresh the image is shown #757
Comments
I don't see what the problem is, please try to rephrase it. (Did you miss a "not" somewhere?) What you describe seems like the default behaviour: at first the image loading takes time (downloading and/or decoding from disk cache), next time it may be in memory cache which means there'll be now I/O in this case it's pointless to delay showing what we already have by displaying a placeholder again. |
Thanks for you answer . I am sorry because of my English is poor. I mean the ImageView always display the placeholder until i manually scroll or refresh the RecyclerView again. I seems it cannot load the real image when its done . It spent enough time to observer this phenomenon. Maybe the follows image can tell me what i said: 2 .After 10 minutes, i refresh the RecyclerView again, it can display the real image well |
Showing the |
I add the RequestListener to observer the callback, it invoke the onResourceReady method. Log is
Code is
So I don't think the cause is that there was an error during loading. Like I said before, "It seems it cannot load the real image when its done at first time". Then I use the Picasso to do the same thing , it works well .
|
Finally , I find out that the problem is occurred when I used CircleImageView . At first, we set the placeholder to ImageView, then we set the “real image” but the placeholder had the same size with the real image , so the ImageView don't auto invalidate(). The difference is
But CircleImageView only support BitmapDrawable and ColorDrawable ,its not well .
The simple way to fix is add the asBitmap() or other way to modify the CircleImageView or GlidDrawable Thank u very much. |
Ah, the magic "Circle view" :) Sorry for not noticing earlier. Here's a nice list. We dug deep and found the core of the problem: #482 (comment) (scroll down a little, the images may make the URL anchor displaced, it's the last long comment by me) You have two options:
While disabling the animation seems easier, you may have more luck with the transformation in the long run. |
THX U very much! |
Thank you guys very much |
I use the RecyclerView and Glide(thanks u very much :) ) in my app , but i find a problem that RecyclerView's item sometimes display the placeholder image res first time , but when i refresh again , it can display the right image from url . The code like this :
Glide.with(BaseApplication.getInstance()).load(imageUrl) .centerCrop() .placeholder(R.drawable.XXX) .crossFade() .into(imageView);
when i remove the placeholder method, it can display the image well .
Bye the way, i use the https://github.com/StanKocken/EfficientAdapter to use the ViewHolder of RecyclerView
i cannot find any way to resolve this problem, can you help me ?
The text was updated successfully, but these errors were encountered: