facebookarchive / shimmer-android

An easy, flexible way to add a shimmering effect to any view in an Android app.
http://facebook.github.io/shimmer-android/
Other
5.31k stars 698 forks source link

ShimmerDrawable with rounded corner #84

Closed henryqwe closed 5 years ago

henryqwe commented 5 years ago

It would be great to add ShimmerDrawable with rounded corner. Is there a plan for implementing such feature?

xiphirx commented 5 years ago

Shimmer just masks content underneath it. If you want it to mask something with rounded corners then just create that something and put it in a ShimmerFrameLayout. You can see this in the sample app.

henryqwe commented 5 years ago

@xiphirx I want to use ShimmerDrawable as placeholder in Glide and it only accepts Drawable object

xiphirx commented 5 years ago

Still, create a Drawable that draws your rounded rect and wrap it with ShimmerDrawable.

henryqwe commented 5 years ago

@xiphirx Could you provide some example because i don't get what you mean by saying wrap Drawable with ShimmerDrawable

Veeyikpong commented 5 years ago

I need help for this issue also. I tried to use ShimmerDrawable as glide placeholder, in my rounded corner cardview, it shows black colored solid corner, but after the image is loaded, then its okay. If i use the xml approach which wrap the imageview inside a ShimmerFrameLayout, then no black colored corner is shown.

I also tried the suggested way by @xiphirx to wrap the shimmerdrawable using DrawableCompat.wrap, I get a drawable object. How do i convert this to GradiantDrawable for me to set its corner radius? Please help. Thanks :)

henryqwe commented 5 years ago

@xiphirx up

i-m-aman commented 4 years ago

Have you find the way of doing it?

behlsoft commented 3 years ago

any update?

rhlmshr commented 3 years ago

Do we have any solution?

yamin8000 commented 3 years ago

I need help for this issue also. I tried to use ShimmerDrawable as glide placeholder, in my rounded corner cardview, it shows black colored solid corner, but after the image is loaded, then its okay. If i use the xml approach which wrap the imageview inside a ShimmerFrameLayout, then no black colored corner is shown.

I also tried the suggested way by @xiphirx to wrap the shimmerdrawable using DrawableCompat.wrap, I get a drawable object. How do i convert this to GradiantDrawable for me to set its corner radius? Please help. Thanks :)

Do we have any solution?

any update?

Have you find the way of doing it?

using cardview gives you rounded corners, I tried many ways to eliminate black colored solid corners the only simple working way was giving a small padding to imageview like 1dp 2dp and that's it. that 1dp or 2dp white padding is not noticeable at least it's better than black corners.