LinearProgressIndicatorSpec

public final class LinearProgressIndicatorSpec extends BaseProgressIndicatorSpec


This class contains the parameters for drawing a linear type progress indicator. The parameters reflect the attributes defined in R.styleable.BaseProgressIndicator and R.styleable.LinearProgressIndicator.

Summary

Public fields

boolean
int

The type of animation of indeterminate mode.

int

The direction in which the indicator will swipe or grow to.

int
float
Integer

The padding of the stop indicator at the end of the track.

int

The size of the stop indicator at the end of the track.

boolean

Public constructors

LinearProgressIndicatorSpec(Context context, AttributeSet attrs)

Instantiates the spec for LinearProgressIndicator.

LinearProgressIndicatorSpec(
    Context context,
    AttributeSet attrs,
    int defStyleAttr
)
LinearProgressIndicatorSpec(
    Context context,
    AttributeSet attrs,
    int defStyleAttr,
    int defStyleRes
)

Public methods

int
boolean

Returns true if the stroke ROUND cap should be used to prevent artifacts like (b/319309456), when fully rounded corners are specified.

Inherited fields

From com.google.android.material.progressindicator.BaseProgressIndicatorSpec
int

The animation behavior to hide the indicator and track.

float

The scale of the animation duration in indeterminate mode.

int[]

The color array used in the indicator.

int

The size of the gap between the indicator and the rest of the track.

int

The animation behavior to show the indicator and track.

int

The color used in the track.

int

When this is greater than 0, the corners of both the track and the indicator will be rounded with this radius.

float

The fraction of the track thickness to be used as the corner radius.

int

The thickness of the track and indicator.

boolean

When this is true, the {#link trackCornerRadiusFraction} takes effect.

int

The size of the amplitude, if a wave effect is configured.

int

The speed of the waveform, if a wave effect is configured.

int

The size of the wavelength in determinate mode, if a wave effect is configured.

int

The size of the wavelength in indeterminate mode, if a wave effect is configured.

Inherited methods

From com.google.android.material.progressindicator.BaseProgressIndicatorSpec
int

Returns the track corner radius in pixels.

boolean
hasWavyEffect(boolean isDeterminate)
boolean
boolean

Public fields

hasInnerCornerRadius

public boolean hasInnerCornerRadius

indeterminateAnimationType

public int indeterminateAnimationType

The type of animation of indeterminate mode.

indicatorDirection

public int indicatorDirection

The direction in which the indicator will swipe or grow to.

trackInnerCornerRadius

public int trackInnerCornerRadius

trackInnerCornerRadiusFraction

public float trackInnerCornerRadiusFraction

trackStopIndicatorPadding

public Integer trackStopIndicatorPadding

The padding of the stop indicator at the end of the track.

trackStopIndicatorSize

public int trackStopIndicatorSize

The size of the stop indicator at the end of the track.

useRelativeTrackInnerCornerRadius

public boolean useRelativeTrackInnerCornerRadius

Public constructors

LinearProgressIndicatorSpec

public LinearProgressIndicatorSpec(Context context, AttributeSet attrs)

Instantiates the spec for LinearProgressIndicator.

If attributes in R.styleable.LinearProgressIndicator are missing, the values in the default style Widget.MaterialComponents.LinearProgressIndicator will be loaded. If attributes in R.styleable.BaseProgressIndicator are missing, the values in the default style Widget.MaterialComponents.ProgressIndicator will be loaded.

Parameters
Context context

Current themed context.

AttributeSet attrs

Component's attributes set.

LinearProgressIndicatorSpec

public LinearProgressIndicatorSpec(
    Context context,
    AttributeSet attrs,
    int defStyleAttr
)

LinearProgressIndicatorSpec

public LinearProgressIndicatorSpec(
    Context context,
    AttributeSet attrs,
    int defStyleAttr,
    int defStyleRes
)

Public methods

getTrackInnerCornerRadiusInPx

public int getTrackInnerCornerRadiusInPx()

useStrokeCap

public boolean useStrokeCap()

Returns true if the stroke ROUND cap should be used to prevent artifacts like (b/319309456), when fully rounded corners are specified.