BaseProgressIndicator

This class contains the common functions shared in different types of progress indicators. This is an abstract class which is not meant for directly use.

With the default style Widget.MaterialComponents.ProgressIndicator, 4dp indicator/track thickness and no animation is used for visibility change. Without customization, primaryColor will be used as the indicator color; the indicator color applying disabledAlpha will be used as the track color. The following attributes can be used to customize the progress indicator's appearance:

  • trackThickness: the thickness of the indicator and track.
  • indicatorColor: the color(s) of the indicator.
  • trackColor: the color of the track.
  • trackCornerRadius: the radius of the rounded corner of the indicator and track.
  • showAnimationBehavior: the animation direction to show the indicator and track.
  • hideAnimationBehavior: the animation direction to hide the indicator and track.

Inheritors

Types

Properties

Link copied to clipboard
val HIDE_ESCAPE: Int = 3
Link copied to clipboard
val HIDE_INWARD: Int = 2
Link copied to clipboard
val HIDE_NONE: Int = 0
Link copied to clipboard
val HIDE_OUTWARD: Int = 1
Link copied to clipboard
val SHOW_INWARD: Int = 2
Link copied to clipboard
val SHOW_NONE: Int = 0
Link copied to clipboard
val SHOW_OUTWARD: Int = 1

Functions

Link copied to clipboard
Returns the corresponding drawable based on current indeterminate state.
Link copied to clipboard
Returns the hide animation behavior used in this progress indicator.
Link copied to clipboard
Returns the array of colors used in the indicator of this progress indicator.
Link copied to clipboard
Returns the size of the gap between the indicator and track in pixels.
Link copied to clipboard
Link copied to clipboard
Returns the show animation behavior used in this progress indicator.
Link copied to clipboard
Returns the color used in the track of this progress indicator.
Link copied to clipboard
Returns the radius of the rounded corner for the indicator and track in pixels.
Link copied to clipboard
Returns the track thickness of this progress indicator in pixels.
Link copied to clipboard
open fun hide()
Hides the progress indicator.
Link copied to clipboard
open fun invalidate()
Link copied to clipboard
open fun setHideAnimationBehavior(hideAnimationBehavior: Int)
Sets the hide animation behavior used in this progress indicator.
Link copied to clipboard
open fun setIndeterminate(indeterminate: Boolean)
Sets the progress mode of the progress indicator.
Link copied to clipboard
Sets a new indeterminate drawable.
Link copied to clipboard
open fun setIndicatorColor(@ColorInt indicatorColors: Array<Int>)
Sets the colors used in the indicator of this progress indicator.
Link copied to clipboard
open fun setIndicatorTrackGapSize(@Px indicatorTrackGapSize: Int)
Sets the size of the gap between the indicator and track in pixels.
Link copied to clipboard
open fun setProgress(progress: Int)
Sets the current progress to the specified value.
Link copied to clipboard
open fun setProgressCompat(progress: Int, animated: Boolean)
Sets the current progress to the specified value with/without animation based on the input.
Link copied to clipboard
open fun setProgressDrawable(@Nullable drawable: Drawable)
Sets a new progress drawable.
Link copied to clipboard
open fun setShowAnimationBehavior(showAnimationBehavior: Int)
Sets the show animation behavior used in this progress indicator.
Link copied to clipboard
open fun setTrackColor(@ColorInt trackColor: Int)
Sets the color of the track of this progress indicator.
Link copied to clipboard
open fun setTrackCornerRadius(@Px trackCornerRadius: Int)
Sets the radius of the rounded corner for the indicator and track in pixels.
Link copied to clipboard
open fun setTrackThickness(@Px trackThickness: Int)
Sets the track thickness of this progress indicator.
Link copied to clipboard
open fun setVisibilityAfterHide(visibility: Int)
Sets the visibility which the component will be after hide animation finishes.
Link copied to clipboard
open fun show()
Shows the progress indicator.