skip to Main Content

Like this (watsapp SS)

I’m stuck with it I can not find how to round profile pics like this and than I don’t know how to constraint my my 3 text views basically I’m trying to create something like this

Screenshot of what I’m trying to say

The problem in the above screenshot (which is of a tutorial on youtube) he used vector asset as an profile but I want to use jgp files and than round it and constraint my 3 textviews accordingly like I said.
I would love some help. Thanks.

3

Answers


  1. You can try these libraries

    CircleImageView
    or
    RoundedImageView

    According to your requirements

    Login or Signup to reply.
  2. Try ShapeableImageView in your android project.
    To use above view in android, you need to add dependency material design 1.2.0 or higher.

    implementation ‘com.google.android.material:material:1.2.0’

    In your style.xml add,

    <style name="ShapeAppearanceOverlay.App.CornerSize50Percent" parent="">
            <item name="cornerSize">50%</item>
        </style>
    

    In your layout file , add this view

    <com.google.android.material.imageview.ShapeableImageView
            android:layout_width="150dp"
            android:layout_height="150dp"
            app:layout_constraintTop_toTopOf="parent"
            app:layout_constraintStart_toStartOf="parent"
            app:layout_constraintEnd_toEndOf="parent"
            app:srcCompat="@mipmap/ic_launcher"
            app:strokeColor="@android:color/darker_gray"  
            android:layout_margin="10dp"
            app:shapeAppearanceOverlay="@style/ShapeAppearanceOverlay.App.CornerSize50Percent"
            />
    

    Result

    enter image description here

    Login or Signup to reply.
  3. You can either make the shapes yourself in the drawable folder which is a lot of work or use third party libraries like hdodenhof/CircleImageView.

    I recommend using the third party library so that you can access it in your xml layouts like any other components

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search