ProgressSpinner

public class ProgressSpinner
extends ProgressBar

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


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

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 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()

Shows the spinner with an animation.

void showWithAnimation(long delayMs)

Shows the spinner with an animation.

void showWithAnimation(long delayMs, AnimatorListenerAdapter listener)

Shows the spinner with an animation and delay.

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 hides the view.

hideWithAnimation

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

hideWithAnimation

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.

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.

showWithAnimation

void showWithAnimation ()

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

showWithAnimation

void showWithAnimation (long delayMs)

Shows the spinner with an animation.

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.

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