Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to decrease the speed of custom ProgressBar

I have implemented a custom progress bar and I am displaying it while getting data from an URL, it is working fine as progress bar is spinning, but my problem is that I am not able to find a proper way to decrease its revolving speed, currently it is spinning very fast.

please help me with your suggestions and reply.

xml layout for progress bar:-

  <ProgressBar
        android:id="@+id/showProgress"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_centerInParent="true"
        android:indeterminateDrawable="@drawable/my_progress_indeterminate" />

Also here's "my_progress_indeterminate" which is used to rotate my custom progressbar :-

<?xml version="1.0" encoding="utf-8"?>
<animated-rotate xmlns:android="http://schemas.android.com/apk/res/android"
    android:drawable="@drawable/image_loading"
    android:pivotX="50%"
    android:pivotY="50%" />

please share some example if possible to decrease the speed of rotation.

Any suggestions will be appreciated.

like image 932
Salman Khan Avatar asked Dec 24 '12 06:12

Salman Khan


People also ask

How do I stop indeterminate progress bar?

How do I stop indeterminate progress bar? An indeterminate progress bar animates constantly. You can stop the animation and clear the progress bar by making the progress bar determinate and setting the current value to the minimum.

What is a standard ProgressBar?

In Android, ProgressBar is used to display the status of work being done like analyzing status of work or downloading a file etc. In Android, by default a progress bar will be displayed as a spinning wheel but If we want it to be displayed as a horizontal bar then we need to use style attribute as horizontal.

What is indeterminate ProgressBar?

ProgressBar is used to display the progress of an activity while the user is waiting. You can display an indeterminate progress (spinning wheel) or result-based progress.


1 Answers

add in code to progress.xml

android:fromDegrees="0"

android:toDegrees="1080"   <!-- Add in code to progress custumize xml to speed up -->
like image 174
Mr_Moradi Avatar answered Sep 25 '22 04:09

Mr_Moradi