I'm trying to create a map marker from a custom view that contains an image inside a CardView. In order to do this, I draw the view to a bitmap using Canvas.
The result is problematic: the markers show the image as a square. What could be causing the CardView lose its corner radius?
The following is my XML layout file for the marker's custom view:
<android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="56dp"
android:layout_height="69dp">
<ImageView
android:id="@+id/discovertab_marker_pin_imageview"
android:layout_width="56dp"
android:layout_height="69dp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:srcCompat="@drawable/mappingreen" />
<android.support.v7.widget.CardView
android:layout_width="50dp"
android:layout_height="50dp"
android:layout_marginEnd="3dp"
android:layout_marginStart="3dp"
android:layout_marginTop="3dp"
app:cardBackgroundColor="@color/colorPrimary"
app:cardCornerRadius="25dp"
app:cardElevation="0dp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent">
<ImageView
android:id="@+id/discovertab_marker_profile_imageview"
android:layout_width="50dp"
android:layout_height="50dp" />
</android.support.v7.widget.CardView>
</android.support.constraint.ConstraintLayout>