public class

ProgressSpinner

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

Class Overview

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

[Expand]
Inherited Constants
From class android.view.View
[Expand]
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 hides the view.
void hideWithAnimation(AnimatorListenerAdapter listener)
Hides the spinner with an animation.
void hideWithAnimation()
Hides the spinner with an animation.
void setColors(int[] colors)
Sets the color(s) to be used in the spinner.
void showWithAnimation(long delayMs, AnimatorListenerAdapter listener)
Shows the spinner with an animation and delay.
void showWithAnimation()
Shows the spinner with an animation.
void showWithAnimation(long delayMs)
Shows the spinner with an animation.
[Expand]
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

public ProgressSpinner (Context context)

public ProgressSpinner (Context context, AttributeSet attrs)

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

Public Methods

public void hide ()

Stops the animation and hides the view.

public void hideWithAnimation (AnimatorListenerAdapter listener)

Hides the spinner with an animation.

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 listener to receive animation callbacks while hiding spinner

public void hideWithAnimation ()

Hides the spinner with an animation.

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

public void setColors (int[] colors)

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

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

public void showWithAnimation (long delayMs, AnimatorListenerAdapter listener)

Shows the spinner with an animation and delay.

Will always cancel all other animations for this spinner instance.

Parameters
delayMs delay before starting the animation in milliseconds
listener listener to receive animation callbacks while showing spinner

public void showWithAnimation ()

Shows the spinner with an animation. This is equivalent to calling showWithAnimation(long) with a delay of 0.

public void showWithAnimation (long delayMs)

Shows the spinner with an animation.

Will always cancel all other animations for this spinner instance.

Parameters
delayMs delay before starting the animation in milliseconds