belongs to Maven artifact com.android.support:wear:28.0.0-alpha1
CircularProgressLayout
public
class
CircularProgressLayout
extends FrameLayout
java.lang.Object | ||||
↳ | android.view.View | |||
↳ | android.view.ViewGroup | |||
↳ | android.widget.FrameLayout | |||
↳ | android.support.wear.widget.CircularProgressLayout |
CircularProgressLayout
adds a circular countdown timer behind the view it contains,
typically used to automatically confirm an operation after a short delay has elapsed.
The developer can specify a countdown interval via setTotalTime(long)
and a listener
via setOnTimerFinishedListener(OnTimerFinishedListener)
to be called when the time has
elapsed after startTimer()
has been called. Tap action can be received via setOnClickListener(OnClickListener)
and can be used to cancel the timer via stopTimer()
method.
Alternatively, this layout can be used to show indeterminate progress by calling setIndeterminate(boolean)
method.
Summary
Nested classes | |
---|---|
interface |
CircularProgressLayout.OnTimerFinishedListener
Interface to implement for listening to |
Inherited constants |
---|
![]()
android.view.ViewGroup
|
![]()
android.view.View
|
Inherited fields |
---|
![]()
android.view.View
|
Public constructors | |
---|---|
CircularProgressLayout(Context context)
|
|
CircularProgressLayout(Context context, AttributeSet attrs)
|
|
CircularProgressLayout(Context context, AttributeSet attrs, int defStyleAttr)
|
|
CircularProgressLayout(Context context, AttributeSet attrs, int defStyleAttr, int defStyleRes)
|
Public methods | |
---|---|
int
|
getBackgroundColor()
Returns the background color of the |
int[]
|
getColorSchemeColors()
Returns the color scheme colors of the progress drawable |
CircularProgressLayout.OnTimerFinishedListener
|
getOnTimerFinishedListener()
Returns the |
CircularProgressDrawable
|
getProgressDrawable()
Returns the |
float
|
getStartingRotation()
Returns the starting rotation of the progress drawable. |
float
|
getStrokeWidth()
Returns the stroke width of the progress drawable in pixels. |
long
|
getTotalTime()
Returns the total time in milliseconds for the timer to countdown to. |
boolean
|
isIndeterminate()
Returns if progress is showing as an indeterminate spinner. |
boolean
|
isTimerRunning()
Returns if the timer is running. |
void
|
setBackgroundColor(int color)
Sets the background color of the |
void
|
setColorSchemeColors(int... colors)
Sets the color scheme colors of the progress drawable, which is equivalent to calling |
void
|
setIndeterminate(boolean indeterminate)
Sets if progress should be shown as an indeterminate spinner. |
void
|
setOnTimerFinishedListener(CircularProgressLayout.OnTimerFinishedListener listener)
Sets the |
void
|
setStartingRotation(float rotation)
Sets the starting rotation for the progress drawable to start from. |
void
|
setStrokeWidth(float strokeWidth)
Sets the stroke width of the progress drawable in pixels. |
void
|
setTotalTime(long totalTime)
Sets the total time in milliseconds for the timer to countdown to. |
void
|
startTimer()
Starts the timer countdown. |
void
|
stopTimer()
Stops the timer countdown. |
Protected methods | |
---|---|
void
|
onDetachedFromWindow()
|
void
|
onLayout(boolean changed, int left, int top, int right, int bottom)
|
Inherited methods | |
---|---|
![]()
android.widget.FrameLayout
| |
![]()
|