The simple way to make rounded corners is by using the CardCornerRadius attribute
app:cardCornerRadius="value"
simply write this in your XML code
<androidx.cardview.widget.CardView
android:id="@+id/cv_info"
...
app:cardCornerRadius="5dp"
...>
and it will work perfectly
image of the cardview
the highest value you'll put in the rounded it will be.
but when we would like to make rounded corners only in certain spots like left bottom, right bottom and so on we will run into a problem, because the CardCornerRadius attribute does it to each side.
I managed to find a solution, not a perfect one, and sometimes this solution is irrelevant for example when you want to do it in the middle of the activity, it will work only if you want this to card view who's in the corners of the activity.
something like that rounded corner image cardView
so what I'm trying to achieve is to make the card view to overflow to activity overflowed cardview
to do this you may set the width of the card view higher than the width of the phone or a better way is to set the width to match the parent and then set the margin to minus.
The XML code will be something like that
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="-16dp"
android:layout_marginLeft="-16dp"
android:layout_marginTop="-26dp"
android:layout_marginEnd="-16dp"
android:layout_marginRight="-16dp"
and then set the app:cardCornerRadius to something high
app:cardCornerRadius="200dp"
and you should get the final result final solution
you can also play with this and make some cool things with that!
I hope it will help someone in the future, I know it's not the most elegant solution or good solution at all but it should do the job, I tried some other things but it seems to be more complicated.