How to implement a circular progress indicator around a button?

I tried many ways to implement the example below, but I could not get it to work universally.

I have already completed the construction of the screen below. I aligned the right and center verticals. and gave some margin.

enter image description here

My problem is that I have to add state onpressedfor this and I need to add circular progress as shown below.

enter image description here

I do not know how to realize this circular progress in this particular place. I tried to realize progress from the left central vertical and gave some margin and fixed it. but when I install it on large screens, alignment goes wrong. Therefore, I tried to implement it from the right vertical vertical and gave an advantage for this circle. But even that didn’t work.

- , : (

: (

EDIT: XML:

<ProgressBar
        android:id="@+id/ProgressBar01"
        android:layout_width="60dp"
        android:layout_height="60dp"
        android:layout_alignParentRight="true"
        android:layout_centerVertical="true"
        android:background="@drawable/circular_progress"
        android:layout_marginRight="185dp"
        android:progress="50" />

    <ImageButton
        android:id="@+id/imageView1"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_alignParentRight="true"
        android:layout_centerVertical="true"
        android:background="@null"
        android:src="@drawable/tap_to_capture" />

    <TextView
        android:id="@+id/textView1"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_alignParentRight="true"
        android:layout_centerVertical="true"
        android:text="@string/tap_to_cap"
        android:textSize="12sp"
        android:textColor="#006666"
        android:layout_marginRight="25dp"
        android:textAppearance="?android:attr/textAppearanceSmall" />
+5
1

XML-, , . .

Screenshots of the layout

XML . , , .

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="wrap_content">

    <RelativeLayout
        android:id="@+id/RelativeLayoutLeftButton"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content" >

        <ProgressBar
            android:id="@+id/progressBar1"
            style="?android:attr/progressBarStyleLarge"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_centerInParent="true" />

        <ImageButton
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_centerInParent="true"
            android:background="@android:color/transparent"
            android:src="@drawable/ic_play" />
    </RelativeLayout>

    <TextView
        android:id="@+id/textView1"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_centerVertical="true"
        android:layout_toRightOf="@+id/RelativeLayoutLeftButton"
        android:text="Click Here"
        android:textAppearance="?android:attr/textAppearanceSmall"
        android:textColor="#006666"
        android:textSize="12sp" />

</RelativeLayout>
+1

All Articles