1

I want to change stroke color of progress bar from default color. Without change background. I used more but still now i didn't get no more result. Can you please give me the solution.

My code is given below,

 <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
        xmlns:tools="http://schemas.android.com/tools"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:orientation="vertical">

        <LinearLayout
            android:id="@+id/timer_rl"
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:paddingTop="40dp"
            android:background="@android:color/white"
            android:visibility="gone"
            android:orientation="vertical">
            <LinearLayout
                android:layout_width="wrap_content"
                android:layout_height="wrap_content">
                <TextView
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_marginLeft="20dp"

                    android:gravity="center"
                    android:layout_gravity="center_horizontal"
                    android:textSize="18sp"
                    android:text="Mobile number verification is in progress..." />
            </LinearLayout>
        <LinearLayout
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:paddingLeft="90dp"
            android:paddingTop="70dp">


            <RelativeLayout
                android:layout_width="150dp"
                android:layout_height="150dp"
                android:layout_centerInParent="true">
        <ProgressBar

            android:layout_width="150dp"
            android:layout_height="150dp"
            android:color="@color/scandal"
            android:indeterminate="true"/>



                <TextView
                    android:id="@+id/timer_tv"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_centerInParent="true"
                    android:textColor="@color/black"
                    android:textSize="26sp" />
            </RelativeLayout>

        </LinearLayout>
        </LinearLayout>
        <LinearLayout
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_alignParentBottom="true"
            android:layout_marginBottom="22dp"
            android:orientation="vertical" >

            <View
                android:layout_width="match_parent"
                android:layout_height="0.5dp"
                android:layout_marginBottom="5dp"
                android:background="@color/lightgray" />

            <TextView
                android:id="@+id/textView2"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_margin="5dp"
                android:text="During verification you will receieve a missed call.\nPlease wait.." />
        </LinearLayout>


    </RelativeLayout>

1 Answers1

1

add this attribute to your xml file

android:indeterminateTint="#FFFFFF"

This attribute will set the color of the progress bar stroke to white you can add whatever color you want

<ProgressBar
    android:layout_width="150dp"
    android:layout_height="150dp"
    android:indeterminate="true"
    android:indeterminateTint="#FFFFFF"/>
john-salib
  • 724
  • 1
  • 12
  • 27