I want to make a surface view which can have rounded corners. This surface view will be useful to render the video camera.
I have already tried adding the surface view in the CardView with this code.
<android.support.v7.widget.CardView
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/cvCard"
android:layout_width="150dp"
android:layout_height="150dp"
android:clipChildren="true"
android:clipToPadding="false"
app:cardCornerRadius="15dp"
app:cardPreventCornerOverlap="false"
app:cardUseCompatPadding="false">
<Surfaceview is Added Programatically>
</android.support.v7.widget.CardView>
The result of this code is this image. As you can see in the round corners the surface view is still visible. It is not entirely round within the card view and it always comes in rectangle shape.
So is there any way to achieve the rounded corner Surfaceview?