-
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 not hidden on first load. Ugly wrong rounded corners of placeholder look through #3195
Comments
On creating a demo project I found the answer to this issue - and was able to fix it without a change to Glide. When defining my background and the placeholder I had used smaller sizes than needed in the layout to match the default vector size of 24dpx24dp. By defining the placeholder and the background in the needed size I could get rid of this glitch on first loading. See this commit: friederikewild/demoGlideTransformations@2edf3b4 However, I'm not sure why the placeholder corner radius was adjusted on loading the image or why it was still visible after the image is loaded. But when using a correctly defined placeholder this isn't a big issue. I'll keep the issue open, just in case it is an easy fix to ensure the placeholder gets set to hide on loading. |
I have the same problem in glide 4.7.1. |
@weidongjian Have you seen my demo project? I managed to fix it on my end, by tweaking the way I define the placeholders. |
@friederikewild But it is still a bug for glide, it not remove placeholder after load image successful |
@weidongjian That's correct. But at least with this trick, it is not an urgent bug to be fixed. |
This issue has been automatically marked as stale because it has not had activity in the last seven days. It will be closed if no further activity occurs within the next seven days. Thank you for your contributions. |
I have the same problem, please help me. |
@chongbo2013 Have you checked out my linked demo project? I agree this is a bug on the glide lib, but at least the above link to my highlighted changes allow to work around this issue by preparing the placeholder in a suitable way. Hope it will help you too. |
@friederikewild The booth map does not load at the beginning and does not disappear after loading, withCrossFade |
@friederikewild do u have facebook ? can u help me. thank u. |
@chongbo2013 Sorry, I'm in a very busy project phase myself. But have a look at my earlier comment with the changes on how I adjusted my placeholder definition to make it work by applying rounded corners to it and define it in the exact same size as the image it is used for. If comparing the code doesn't help you, maybe edit your post and provide more information e.g. how the placeholder is defined. |
@sjudd Thanks for the link. From what I understand there it seems that using Or is this call something else then what Also, the interesting observation I made and that I am showing on the initial screenshot is that somehow my placeholder's rounded corners got stretched to be less round when an image was loaded with glide to replace it. Just as a fallback on itself the different "rounding" was much less obvious. I was wondering if that might hint to another underlying issue. |
The link says that |
Thanks for the clarification @sjudd :) now I got it. So the issue I was initially observing is down to using |
This issue has been automatically marked as stale because it has not had activity in the last seven days. It will be closed if no further activity occurs within the next seven days. Thank you for your contributions. |
Experiencing this problem on 4.7.1. Placeholder is vector drawable, might be related in some way. If the image is already cached, bug is not reproduced. Placeholder is not corrupted in any way, but it stays under loaded png image with transparency Here's my code. |
Chimming in. I too would be grateful to see this resolved. |
Locking this so the answer doesn't get hidden: http://bumptech.github.io/glide/doc/transitions.html#cross-fading-with-placeholders-and-transparent-images |
…id wrong interpretation of corner radius
Glide Version: 4.6.1
Integration libraries: okhttp3-integration (okhttp version: 3.9.1)
Device/Android Version: fails on Google Pixel, Emulator and other phones
Issue details / Repro steps / Use case background:
I want to load an image and cut it to rounded corners
During loading or if failing I want a placeholder (defined with the same rounded corners)
In addition, I want a white border that has the same rounded corners
Issue happens in the same way both in a list (following the adapter integration) and on a simple screen
Expected: During loading and on-error I see the placeholder with rounded corners and with white border. On loading (no matter if first one or from cache) I see the picture with rounded corners and white border.
Actual behavior: Only on the first successful load of the image I get ugly glitches in the corners in the color of my placeholder. This looks like 2 issues:
Glide load line /
GlideModule
(if any) / list Adapter code (if any):My
GlideModule
is only setting up cookie handling with okhttp, so don't think this is related.Note: I also tried to use the
RoundedCornersTransformation
from "jp.wasabeef:glide-transformations:3.3.0" instead ofRoundedCorners
and this leads to the same behaviour. Which is why I believe it's related to the placeholder.Layout XML (No difference using
scaleType=fitCenter
):Define radius in dimens.xml:
placeholder_thumbnail_square_primary.xml:
bg_square_rounded_white.xml:
Stack trace / LogCat:
None
3 Screenshots from the same image in different states:
The text was updated successfully, but these errors were encountered: