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

Inherited fields

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 View.GONE.

void hideWithAnimation(AnimatorListenerAdapter listener)

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

void hideWithAnimation()

Hides the spinner with an animation and sets the view's visibility to View.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 View.VISIBLE when the animation starts.

void showWithAnimation(long delayMs)

Shows the spinner with an animation and sets this view's visibility to View.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 View.VISIBLE when the animation starts.

Inherited methods

Public constructors

ProgressSpinner

public ProgressSpinner (Context context)

Parameters
context Context

ProgressSpinner

public ProgressSpinner (Context context, 
                AttributeSet attrs)

Parameters
context Context

attrs AttributeSet

ProgressSpinner

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

Parameters
context Context

attrs AttributeSet

defStyle int

Public methods

hide

public void hide ()

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

hideWithAnimation

public void hideWithAnimation (AnimatorListenerAdapter listener)

Hides the spinner with an animation and sets the view's visibility to View.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

public void hideWithAnimation ()

Hides the spinner with an animation and sets the view's visibility to View.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

public 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

public void setVisibility (int visibility)

Parameters
visibility int

showWithAnimation

public void showWithAnimation ()

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

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

showWithAnimation

public void showWithAnimation (long delayMs)

Shows the spinner with an animation and sets this view's visibility to View.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

public void showWithAnimation (long delayMs, 
                AnimatorListenerAdapter listener)

Shows the spinner with an animation and delay and sets this view's visibility to View.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