CircularProgressDrawable
open class CircularProgressDrawable : Drawable, Animatable
kotlin.Any | ||
↳ | android.graphics.drawable.Drawable | |
↳ | androidx.swiperefreshlayout.widget.CircularProgressDrawable |
Drawable that renders the animated indeterminate progress indicator in the Material design style without depending on API level 11.
While this may be used to draw an indeterminate spinner using start()
and
methods, this may also be used to draw a progress arc using
method. CircularProgressDrawable also supports adding an arrow at the end of the arc by setArrowEnabled(boolean)
and setArrowDimensions(float, * float)
methods.
To use one of the pre-defined sizes instead of using your own, setStyle(int)
should be called with one of the DEFAULT
or LARGE
styles as its parameter. Doing it so will update the arrow dimensions, ring size and stroke width to fit the one specified.
If no center radius is set via setCenterRadius(float)
or setStyle(int)
methods, CircularProgressDrawable will fill the bounds set via setBounds(Rect)
.
Summary
Constants | |
---|---|
static Int |
Maps to ProgressBar default style. |
static Int |
Maps to ProgressBar. |
Public constructors | |
---|---|
Public methods | |
---|---|
open Unit | |
open Int |
getAlpha() |
open Boolean |
Returns |
open Float |
Returns the arrow height in pixels. |
open Float |
Returns the scale of the arrow at the end of the spinner. |
open Float |
Returns the arrow width in pixels. |
open Int |
Returns the background color of the circle drawn inside the drawable. |
open Float |
Returns the center radius for the progress spinner in pixels. |
open IntArray |
Returns the colors used in the progress animation |
open Float |
Returns the end trim for the progress spinner arc |
open Int | |
open Float |
Returns the amount of rotation applied to the progress spinner. |
open Float |
Returns the start trim for the progress spinner arc |
open Cap |
Returns the stroke cap of the progress spinner. |
open Float |
Returns the stroke width for the progress spinner in pixels. |
open Boolean | |
open Unit | |
open Unit |
setArrowDimensions(width: Float, height: Float) Sets the dimensions of the arrow at the end of the spinner in pixels. |
open Unit |
setArrowEnabled(show: Boolean) Sets if the arrow at the end of the spinner should be shown. |
open Unit |
setArrowScale(scale: Float) Sets the scale of the arrow at the end of the spinner. |
open Unit |
setBackgroundColor(color: Int) Sets the background color of the circle inside the drawable. |
open Unit |
setCenterRadius(centerRadius: Float) Sets the center radius for the progress spinner in pixels. |
open Unit |
setColorFilter(colorFilter: ColorFilter?) |
open Unit |
setColorSchemeColors(@NonNull vararg colors: Int) Sets the colors used in the progress animation from a color list. |
open Unit |
setProgressRotation(rotation: Float) Sets the amount of rotation to apply to the progress spinner. |
open Unit |
setStartEndTrim(start: Float, end: Float) Sets the start and end trim for the progress spinner arc. |
open Unit |
setStrokeCap(@NonNull strokeCap: Cap) Sets the stroke cap of the progress spinner. |
open Unit |
setStrokeWidth(strokeWidth: Float) Sets the stroke width for the progress spinner in pixels. |
open Unit |
Sets the overall size for the progress spinner. |
open Unit |
start() Starts the animation for the spinner. |
open Unit |
stop() Stops the animation for the spinner. |