Open top menu

Android Custom Circle  Shape ProgrssBar with Animation ?

In blog explain how to create Circle ProgressBar in android ....try this

Step 1 Create anim class inside res/drawable/circle_progress_anim...

circle_progress_anim.xml
...................................................................................................................................................................

<?xml version="1.0" encoding="utf-8"?>
<rotate xmlns:android="http://schemas.android.com/apk/res/android"
    android:duration="1000"
    android:fromDegrees="0"
    android:pivotX="50%"
    android:pivotY="50%"
    android:toDegrees="360" >
    <shape
        android:innerRadius="60dp"
        android:shape="oval"
        android:thickness="4dp"
        android:useLevel="false" >
        <size
            android:height="80dp"
            android:width="80dp" />
        <gradient
            android:centerColor="#1e6008"
            android:centerY="0.5"
            android:endColor="#afab24"
            android:startColor="#0d4599"
            android:type="sweep"
            android:useLevel="false" />
    </shape>
</rotate>

Step 2.Create activity_main.xml class inside res/layout/ folder..

activity_main.xml.
...................................................................................................................................................................

<LinearLayout 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" >

    <ImageView
        android:id="@+id/imageView1"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:src="@drawable/logoweb" />

   <ProgressBar
   android:layout_width="200dp"
   android:layout_height="200dp"
   android:layout_gravity="center"
   android:layout_marginTop="60dp"
   android:indeterminateDrawable="@drawable/circle
_progress_anim" />

</LinearLayout>










 Learn More...

0 comments