LinearProgressIndicator

This class implements the linear type progress indicators.

With the default style Widget.MaterialComponents.LinearProgressIndicator, 4dp indicator/track thickness is used without animation is used for visibility change. Without customization, primaryColor will be used as the indicator color; the track is the (first) indicator color applying the disabledAlpha. The following attributes can be used to customize the component'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.
  • indeterminateAnimationType: the type of indeterminate animation.
  • indicatorDirectionLinear: the sweeping direction of the indicator.

For more information, see the component developer guidance and design guidelines.

Constructors

Link copied to clipboard
constructor(@NonNull context: Context)
constructor(@NonNull context: Context, @Nullable attrs: AttributeSet)
constructor(@NonNull context: Context, @Nullable attrs: AttributeSet, @AttrRes defStyleAttr: Int)

Types

Functions

Link copied to clipboard
Returns the type of indeterminate animation of this progress indicator.
Link copied to clipboard
Returns the indicator animating direction used in this progress indicator.
Link copied to clipboard
Returns the size of the stop indicator at the end of the track in pixels.
Link copied to clipboard
open fun setIndeterminateAnimationType(indeterminateAnimationType: Int)
Sets the type of indeterminate animation.
Link copied to clipboard
open fun setIndicatorColor(@NonNull indicatorColors: Array<Int>)
Sets the colors used in the indicator of this progress indicator.
Link copied to clipboard
open fun setIndicatorDirection(indicatorDirection: Int)
Sets the indicator animating direction used in this progress indicator.
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 setTrackCornerRadius(trackCornerRadius: Int)
Sets the radius of the rounded corner for the indicator and track in pixels.
Link copied to clipboard
open fun setTrackStopIndicatorSize(@Px trackStopIndicatorSize: Int)
Sets the size of the stop indicator at the end of the track in pixels.