This is an ImageView that implements rounded corners by overriding the onDraw() method.
Make sure your project support Kotlin and using androidx dependecies.
Add the JitPack repository to your build file.
allprojects {
repositories {
...
maven { url 'https://jitpack.io' }
}
}Add the dependency.
dependencies {
implementation 'com.github.symeonchen:roundImageView:latest'
}Use it like use ImageView.
<com.symeonchen.roundimageview.RoundImageView
android:id="@+id/riv_sample"
android:layout_width="200dp"
android:layout_height="50dp"
android:src="#9F9CEA"
app:corner_radius="25dp"
app:top_end="false"
app:top_start="false" />MIT License
Copyright (c) 2020 SymeonChen
