STEP - 1)

main.xml:(add this to your main.xml):

<ProgressBar 
android:id="@+id/ProgressBar01" 
android:layout_width="121dp" 
android:layout_height="15dp" 
android:progress="50"
android:max="100" 
android:secondaryProgress="0"
style="?android:attr/progressBarStyleHorizontal" 
android:progressDrawable="@drawable/myprogressbar" 
android:layout_marginTop="10dp"
/>
</LinearLayout>


  
 STEP - 2) 
myprogressbar.xml (save this xml in drawable folder)

<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
    <item android:id="@android:id/background">
        <shape>
            <corners android:radius="25dip" />
            <gradient android:startColor="#C0C0C0" android:centerColor="#F8F8FF"
                android:centerY="0.75" android:endColor="#ffffff" android:angle="90" />
            <stroke android:width="1dp" android:color="#6B8E23" />
        </shape>
    </item>
    <item android:id="@android:id/progress">
        <clip>
            <shape>
                <corners android:radius="25dip" />
                <gradient android:startColor="#9ACD32" android:endColor="#FFFF00"
                    android:angle="90" />
                <stroke android:width="1dp" android:color="#6B8E23" />
            </shape>
        </clip>
    </item>
</layer-list>

Posted by [czar]
,