How to add icon in the circular image view

Logic is here to use frame layout

 <FrameLayout
                    android:layout_width="150dp"
                    android:layout_height="150dp"
                    android:layout_gravity="center"
                    android:layout_marginTop="10dp">

                    <xxx.xxxx.CircleImageView
                        android:id="@+id/profilePic"
                        android:layout_width="150dp"
                        android:layout_height="150dp"
                        android:src="@drawable/male"
                        android:layout_gravity="bottom|center_horizontal" />

                    <xxx.xxx.CircleImageView
                        android:id="@+id/iv_camera"
                        android:layout_width="40dp"
                        android:layout_height="40dp"
                        android:src="@drawable/editfloat"
                        android:layout_gravity="top|right"

                        />
                </FrameLayout>

   <FrameLayout
            android:id="@+id/image_logo"
            android:layout_width="150dp"
            android:layout_height="150dp"
            android:layout_gravity="center"
            android:layout_marginTop="@dimen/padding_48"
            app:layout_constraintEnd_toEndOf="parent"
            app:layout_constraintStart_toStartOf="parent"
            app:layout_constraintTop_toTopOf="parent">

            <androidx.appcompat.widget.AppCompatImageView
                android:id="@+id/profilePic"
                android:layout_width="match_parent"
                android:layout_height="match_parent"
                android:layout_gravity="bottom|center_horizontal"
                app:srcCompat="@drawable/ic_profile" />

            <androidx.appcompat.widget.AppCompatImageView
                android:id="@+id/iv_camera"
                android:layout_width="40dp"
                android:layout_height="40dp"
                android:layout_gravity="bottom|right"
                app:srcCompat="@drawable/add_profile"
                />
        </FrameLayout>

add_profile

<?xml version="1.0" encoding="utf-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
    <item>
        <shape android:shape="oval">
            <solid android:color="@color/rosy_pink"/>
        </shape>
    </item>
    <item
        android:drawable="@drawable/ic_item_select_plus_add"
        android:bottom="@dimen/padding_12"
        android:left="@dimen/padding_12"
        android:right="@dimen/padding_12"
        android:top="@dimen/padding_12"/>
</layer-list>


           `android:layout_gravity="bottom|right"`

result :

NOTE : For second Image position just change


You're using a library for Circular ImageView. So you need to check if there's any attribute to set an icon inside the ImageView. Anyway, here's how you can achieve the desired behaviour. You can add an image with the camera icon inside instead of setting a background colour.

<com.almabay.almachat.circularImageView.CircularImageView
    android:id="@+id/iv_camera"
    android:layout_width="80dp"
    android:layout_height="80dp"
    android:layout_gravity="top|right"
    android:layout_marginTop="@dimen/margin30"
    android:background="@drawable/image_with_camera" />

Another approach you might try to get this behaviour is setting the camera image as a src attribute.

<com.almabay.almachat.circularImageView.CircularImageView
    android:id="@+id/iv_camera"
    android:layout_width="80dp"
    android:layout_height="80dp"
    android:layout_gravity="top|right"
    android:layout_marginTop="@dimen/margin30"
    android:background="@drawable/color"
    android:padding="5dp"
    android:src="@drawable/image_camera" />