You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
So I need to make the CirleImageView to be more like a button. And I want this view to show some custom or maybe online image. So FloatActionButton won't be a solution.
The background color can't be @android:color/transparent, it will make elevation disappear.
Then set this background to CircleImageView. and set an elevation. But I soon find out that the elevation is partially cut off like this
I think that's because the shadow reached the boarder of view
So I added a Layout to wrap around CircleImageView and make it slightly larger than CircleImageView.
So the code looks like this
Nice work! Since version 2.2.0 CircleImageView actually comes with native support for elevation, hence it shouldn't be required to add a circle shaped background anymore.
A wrapper is still needed or the elevation will be cut off on the edge.
Correct, that's actually also these case for a regular ImageView. I'll close this for now as it's not really an issue with the library that needs to be worked on.
So I need to make the CirleImageView to be more like a button. And I want this view to show some custom or maybe online image. So FloatActionButton won't be a solution.
I referenced to this issue and come up with a solution:
So to have a elevation, we must have a background, this is my background
The background color can't be
@android:color/transparent
, it will make elevation disappear.Then set this background to CircleImageView. and set an elevation. But I soon find out that the elevation is partially cut off like this
I think that's because the shadow reached the boarder of view
So I added a Layout to wrap around CircleImageView and make it slightly larger than CircleImageView.
So the code looks like this
And this makes CircleImageView have a nice shadow like a FAB. It's even better when I added a ripple animation using this workaround
The text was updated successfully, but these errors were encountered: