Android-5: Card and images with rounded corners in Android 4

Card and images with rounded corners in Android 4
As you know the CardView in support library has a different behaviour for API=21 and API < 21.

If you would like to have an image (full or partial) inside your cardView with Rounded corners it is by default only in Android 5.

This gist can be useful to achieve the same aspect also in Android V4 (and as always it can be improved)
Here the link.

The trick is to elaborate the image and obtain an image with rounded corners (I am using the snippet published by +Romain Guy)

Pay attention: you have to use
cardView.setPreventCornerOverlap(false); to avoid the internal padding in api<21.

Comments

  1. Really impressed! Everything is very open and very clear clarification of issues. It contains truly facts. Your website is very valuable. Thanks for sharing.
    스포츠토토

    ReplyDelete
  2. I do accept as true with all the concepts you’ve offered
    on your post. They are very convincing and can definitely work.
    Nonetheless, the posts are very quick for starters. May just you please lengthen them a bit from next time?
    일본야동

    ReplyDelete
  3. I was reading some of your content on this website and I conceive this internet site is really informative ! Keep on putting up.
    토토사이트

    ReplyDelete

Post a Comment

Popular posts from this blog

How to centralize the support libraries dependencies in gradle

AntiPattern: freezing a UI with Broadcast Receiver

NotificationListenerService and kitkat