Skip to content

Most visited

Recently visited

navigation

ProgressSpinner

public class ProgressSpinner
extends ProgressBar

java.lang.Object
   ↳ android.view.View
     ↳ android.widget.ProgressBar
       ↳ android.support.wearable.view.ProgressSpinner


This class is deprecated.
consider using ProgressBar instead. This class has been deprecated for consistency with Android framework.

An indeterminate progress spinner designed for wearables which cycles through colors. There are four valid ways for colors to be set.

  • Do nothing. The defaults will be used.
  • Specify an array containing colors in the colors attribute
  • Specify a single color in the colors attribute
  • Call setColors(int[]) with the ARGB color values

Summary

Inherited constants

From class android.view.View

Inherited fields

From class android.view.View

Public constructors

ProgressSpinner(Context context)
ProgressSpinner(Context context, AttributeSet attrs)
ProgressSpinner(Context context, AttributeSet attrs, int defStyle)

Public methods

void hide()

Stops the animation and sets the view's visibility to GONE.

void hideWithAnimation(AnimatorListenerAdapter listener)

Hides the spinner with an animation and sets the view's visibility to GONE asynchronously when the animation ends.

void hideWithAnimation()

Hides the spinner with an animation and sets the view's visibility to GONE asynchronously when the animation ends.

void setColors(int[] colors)

Sets the color(s) to be used in the spinner.

void setVisibility(int visibility)
void showWithAnimation()

Shows the spinner with an animation and sets this view's visibility to VISIBLE when the animation starts.

void showWithAnimation(long delayMs)

Shows the spinner with an animation and sets this view's visibility to VISIBLE when the animation starts.

void showWithAnimation(long delayMs, AnimatorListenerAdapter listener)

Shows the spinner with an animation and delay and sets this view's visibility to VISIBLE when the animation starts.

Inherited methods

From class android.widget.ProgressBar
From class android.view.View
From class java.lang.Object
From interface android.graphics.drawable.Drawable.Callback
From interface android.view.KeyEvent.Callback
From interface android.view.accessibility.AccessibilityEventSource

Public constructors

ProgressSpinner

ProgressSpinner (Context context)

Parameters
context Context

ProgressSpinner

ProgressSpinner (Context context, 
                AttributeSet attrs)

Parameters
context Context

attrs AttributeSet

ProgressSpinner

ProgressSpinner (Context context, 
                AttributeSet attrs, 
                int defStyle)

Parameters
context Context

attrs AttributeSet

defStyle int

Public methods

hide

void hide ()

Stops the animation and sets the view's visibility to GONE.

hideWithAnimation

void hideWithAnimation (AnimatorListenerAdapter listener)

Hides the spinner with an animation and sets the view's visibility to GONE asynchronously when the animation ends.

Will always cancel all other animations for this spinner instance regardless of whether the hide animation will actually run.

If the hide animation will not run because of the existing visible state of the spinner, the listener onAnimationEnd() method will be called immediately with a null Animation.

Parameters
listener AnimatorListenerAdapter: listener to receive animation callbacks while hiding spinner

hideWithAnimation

void hideWithAnimation ()

Hides the spinner with an animation and sets the view's visibility to GONE asynchronously when the animation ends.

Will always cancel all other animations for this spinner instance regardless of whether the hide animation will actually run.

setColors

void setColors (int[] colors)

Sets the color(s) to be used in the spinner. They will be shown repeatedly and sequentially.

Parameters
colors int: Array of one or more integers representing colors in ARGB format.

setVisibility

void setVisibility (int visibility)

Parameters
visibility int

showWithAnimation

void showWithAnimation ()

Shows the spinner with an animation and sets this view's visibility to VISIBLE when the animation starts.

This is equivalent to calling showWithAnimation(long) with a delay of 0.

showWithAnimation

void showWithAnimation (long delayMs)

Shows the spinner with an animation and sets this view's visibility to VISIBLE when the animation starts.

Will always cancel all other animations for this spinner instance.

Parameters
delayMs long: delay before starting the animation in milliseconds

showWithAnimation

void showWithAnimation (long delayMs, 
                AnimatorListenerAdapter listener)

Shows the spinner with an animation and delay and sets this view's visibility to VISIBLE when the animation starts.

Will always cancel all other animations for this spinner instance.

Parameters
delayMs long: delay before starting the animation in milliseconds

listener AnimatorListenerAdapter: listener to receive animation callbacks while showing spinner

This site uses cookies to store your preferences for site-specific language and display options.

Get the latest Android developer news and tips that will help you find success on Google Play.

* Required Fields

Hooray!

Follow Google Developers on WeChat

Browse this site in ?

You requested a page in , but your language preference for this site is .

Would you like to change your language preference and browse this site in ? If you want to change your language preference later, use the language menu at the bottom of each page.

This class requires API level or higher

This doc is hidden because your selected API level for the documentation is . You can change the documentation API level with the selector above the left navigation.

For more information about specifying the API level your app requires, read Supporting Different Platform Versions.

Take a short survey?
Help us improve the Android developer experience. (Dec 2017 Android Platform & Tools Survey)