Circle ImageView

Hello.
In this tutorial you will see how to easily make your ImageView round.

First, add dependency to you app module:

build.gradle(Module:app)
implementation 'de.hdodenhof:circleimageview:2.2.0'

And now simply add CircleImageView to your layout file. For example:

activity_main.xml
<de.hdodenhof.circleimageview.CircleImageView
    xmlns:app="http://schemas.android.com/apk/res-auto"
    android:id="@+id/profile_image"
    android:layout_width="96dp"
    android:layout_height="96dp"
    android:src="@drawable/profile"
    app:civ_border_width="2dp"
    app:civ_border_color="#FF000000"/>

And that is all. There is no need for any operations in your activity, this is all you need to do to make your image rounded.
Cheers 😀

Share with your friends