[Library Demo] ShapedImageView -
Android library demo
Custom shape ImageView using PorterDuffXfermode with paint shapes and SVGs
.
https://github.com/MostafaGazar/CustomShapeImageView
.
Usage:
android:layout_width="64dp"
android:layout_height="64dp"
android:src="@drawable/sample"
app:shape="circle"
android:scaleType="centerCrop" />
android:layout_width="64dp"
android:layout_height="64dp"
android:src="@drawable/sample"
android:scaleType="centerCrop" />
android:layout_width="64dp"
android:layout_height="64dp"
android:src="@drawable/sample"
android:scaleType="centerCrop" />
android:layout_width="64dp"
android:layout_height="64dp"
android:src="@drawable/sample"
app:svg_raw_resource="@raw/shape_star"
android:scaleType="centerCrop" />
.
Libraries used:
https://github.com/latemic/svg-android