Butterfly
Butterfly

Reputation: 455

Progressbar indeterminate drawable vs progressDrawable

I need to create spinner circulate progressbar that circulate starting from bottom (progress go from 0 to max) to top and when reaches to top starting to minimized(progress max to 0) and then stating again from bottom.

Here is my prgressbar

<ProgressBar
        style="?android:attr/progressBarStyle"
        android:layout_width="70dp"
        android:layout_height="70dp"
        android:id="@+id/progressBar2"
        android:indeterminateDrawable="@drawable/progressbar_circle"
        android:progressTintMode="src_atop"
        android:layout_centerInParent="true"
        android:indeterminateDuration="500"
        android:layout_marginTop="189dp"
        android:indeterminateOnly="true"
        />

Here is the drawable progressbar_circle.xml

<?xml version="1.0" encoding="utf-8"?>
<rotate xmlns:android="http://schemas.android.com/apk/res/android"
    android:pivotX="50%" android:pivotY="50%" android:fromDegrees="90"
    android:toDegrees="270">
    <shape android:shape="ring"
        android:thicknessRatio="13" android:useLevel="false">

        <size android:width="76dip" android:height="76dip" />
        <gradient android:type="sweep" android:useLevel="false"
            android:centerColor="#000cbdfb"
            android:endColor="#f168c1"
            android:angle="0"
            />
    </shape>
</rotate>

When in my progressbar I give drawable as indeterminateDrawable. It's only circulate from bottom to top and begin from bottom immediately(I can't reach to effect when in top it starts to minimized).

Upvotes: 0

Views: 3768

Answers (1)

Sabeeh
Sabeeh

Reputation: 1263

change your rotate drawable parameters like this

android:fromDegrees="90"
android:toDegrees="450"

Upvotes: 1

Related Questions