-1

I want to give it a pretty rounded like image.

enter image description here

enter image description here

karel
  • 5,489
  • 46
  • 45
  • 50

2 Answers2

1

You can use ShapeableImageView from the Material Library :

<com.google.android.material.imageview.ShapeableImageView
      android:id="@+id/image_view"
      app:shapeAppearanceOverlay="@style/circleImageView"
      app:srcCompat="@drawable/..." />

In style.xml/ theme.xml

 <style name="circleImageView" parent="">
    <item name="cornerFamily">rounded</item>
    <item name="cornerSize">50%</item>
  </style>

This will create a circle Imageview.

You can also create different shapes using this. (Just google ShapeableImageView if you need to learn more)

0

You can use fresco library :

Add in you app level gradle

implementation "com.facebook.fresco:fresco:2.0.0"

In you layout

<com.facebook.drawee.view.SimpleDraweeView
    android:id="@+id/sdv_user_profile"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:layout_gravity="center"
    android:src="@{model.image}"
    app:actualImageScaleType="fitCenter"
    app:backgroundImage="@drawable/user_profile"
    app:progressBarAutoRotateInterval="1000"
    app:progressBarImage="@drawable/progress"
    app:progressBarImageScaleType="centerInside"
    app:roundAsCircle="true"
    app:roundingBorderColor="@color/grayColorLight"
    app:roundingBorderWidth="@dimen/_2sdp" />