# BaseProgressIndicatorSpec

[View Source](https://github.com/material-components/material-components-android/blob/1.14.0/lib/java/com/google/android/material/progressindicator/BaseProgressIndicatorSpec.java)

*** ** * ** ***


```
public abstract class BaseProgressIndicatorSpec
```

<br />

Known direct subclasses [CircularProgressIndicatorSpec](https://developer.android.com/reference/com/google/android/material/progressindicator/CircularProgressIndicatorSpec), [LinearProgressIndicatorSpec](https://developer.android.com/reference/com/google/android/material/progressindicator/LinearProgressIndicatorSpec)

|---|---|
| `https://developer.android.com/reference/com/google/android/material/progressindicator/CircularProgressIndicatorSpec` | This class contains the parameters for drawing a circular type progress indicator. |
| `https://developer.android.com/reference/com/google/android/material/progressindicator/LinearProgressIndicatorSpec` | This class contains the parameters for drawing a linear type progress indicator. |

*** ** * ** ***

This class contains the parameters shared between linear type and circular type. The parameters reflect the attributes defined in `R.styleable.BaseProgressIndicator`.

## Summary

| ### Public fields |
|---|---|
| `int` | `https://developer.android.com/reference/com/google/android/material/progressindicator/BaseProgressIndicatorSpec#hideAnimationBehavior()` The animation behavior to hide the indicator and track. |
| `float` | `https://developer.android.com/reference/com/google/android/material/progressindicator/BaseProgressIndicatorSpec#indeterminateAnimatorDurationScale()` The scale of the animation duration in indeterminate mode. |
| `int[]` | `https://developer.android.com/reference/com/google/android/material/progressindicator/BaseProgressIndicatorSpec#indicatorColors()` The color array used in the indicator. |
| `int` | `https://developer.android.com/reference/com/google/android/material/progressindicator/BaseProgressIndicatorSpec#indicatorTrackGapSize()` The size of the gap between the indicator and the rest of the track. |
| `int` | `https://developer.android.com/reference/com/google/android/material/progressindicator/BaseProgressIndicatorSpec#showAnimationBehavior()` The animation behavior to show the indicator and track. |
| `int` | `https://developer.android.com/reference/com/google/android/material/progressindicator/BaseProgressIndicatorSpec#trackColor()` The color used in the track. |
| `int` | `https://developer.android.com/reference/com/google/android/material/progressindicator/BaseProgressIndicatorSpec#trackCornerRadius()` When this is greater than 0, the corners of both the track and the indicator will be rounded with this radius. |
| `float` | `https://developer.android.com/reference/com/google/android/material/progressindicator/BaseProgressIndicatorSpec#trackCornerRadiusFraction()` The fraction of the track thickness to be used as the corner radius. |
| `int` | `https://developer.android.com/reference/com/google/android/material/progressindicator/BaseProgressIndicatorSpec#trackThickness()` The thickness of the track and indicator. |
| `boolean` | `https://developer.android.com/reference/com/google/android/material/progressindicator/BaseProgressIndicatorSpec#useRelativeTrackCornerRadius()` When this is true, the {#link trackCornerRadiusFraction} takes effect. |
| `int` | `https://developer.android.com/reference/com/google/android/material/progressindicator/BaseProgressIndicatorSpec#waveAmplitude()` The size of the amplitude, if a wave effect is configured. |
| `float` | `https://developer.android.com/reference/com/google/android/material/progressindicator/BaseProgressIndicatorSpec#waveAmplitudeRampProgressMax()` The normalized progress, at which the full wave amplitude will be ramped down. |
| `float` | `https://developer.android.com/reference/com/google/android/material/progressindicator/BaseProgressIndicatorSpec#waveAmplitudeRampProgressMin()` The normalized progress, at which the full wave amplitude will be ramped up. |
| `int` | `https://developer.android.com/reference/com/google/android/material/progressindicator/BaseProgressIndicatorSpec#waveSpeed()` The speed of the waveform, if a wave effect is configured. |
| `int` | `https://developer.android.com/reference/com/google/android/material/progressindicator/BaseProgressIndicatorSpec#wavelengthDeterminate()` The size of the wavelength in determinate mode, if a wave effect is configured. |
| `int` | `https://developer.android.com/reference/com/google/android/material/progressindicator/BaseProgressIndicatorSpec#wavelengthIndeterminate()` The size of the wavelength in indeterminate mode, if a wave effect is configured. |

| ### Protected constructors |
|---|
| `https://developer.android.com/reference/com/google/android/material/progressindicator/BaseProgressIndicatorSpec#BaseProgressIndicatorSpec(Context,AttributeSet,int,int)( Context context, AttributeSet attrs, int defStyleAttr, int defStyleRes )` Instantiates BaseProgressIndicatorSpec. |

| ### Public methods |
|---|---|
| `int` | `https://developer.android.com/reference/com/google/android/material/progressindicator/BaseProgressIndicatorSpec#getTrackCornerRadiusInPx()()` Returns the track corner radius in pixels. |
| `boolean` | `https://developer.android.com/reference/com/google/android/material/progressindicator/BaseProgressIndicatorSpec#hasWavyEffect(boolean)(boolean isDeterminate)` |
| `boolean` | `https://developer.android.com/reference/com/google/android/material/progressindicator/BaseProgressIndicatorSpec#isHideAnimationEnabled()()` |
| `boolean` | `https://developer.android.com/reference/com/google/android/material/progressindicator/BaseProgressIndicatorSpec#isShowAnimationEnabled()()` |
| `boolean` | `https://developer.android.com/reference/com/google/android/material/progressindicator/BaseProgressIndicatorSpec#useStrokeCap()()` Returns true if the stroke ROUND cap should be used to prevent artifacts like (b/319309456), when fully rounded corners are specified. |

## Public fields

### hideAnimationBehavior

```
public int hideAnimationBehavior
```

The animation behavior to hide the indicator and track.

### indeterminateAnimatorDurationScale

```
public float indeterminateAnimatorDurationScale
```

The scale of the animation duration in indeterminate mode.

### indicatorColors

```
public int[] indicatorColors
```

The color array used in the indicator. In determinate mode, only the first item will be used.

### indicatorTrackGapSize

```
public int indicatorTrackGapSize
```

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

### showAnimationBehavior

```
public int showAnimationBehavior
```

The animation behavior to show the indicator and track.

### trackColor

```
public int trackColor
```

The color used in the track. If not defined, it will be set to the indicatorColors and apply the first disable alpha value from the theme.

### trackCornerRadius

```
public int trackCornerRadius
```

When this is greater than 0, the corners of both the track and the indicator will be rounded with this radius. If the radius is greater than half of the track width, an `
IllegalArgumentException` will be thrown during initialization.

### trackCornerRadiusFraction

```
public float trackCornerRadiusFraction
```

The fraction of the track thickness to be used as the corner radius. And the stroke ROUND cap is used to prevent artifacts like (b/319309456), when 0.5f is specified.

### trackThickness

```
public int trackThickness
```

The thickness of the track and indicator.

### useRelativeTrackCornerRadius

```
public boolean useRelativeTrackCornerRadius
```

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

### waveAmplitude

```
public int waveAmplitude
```

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

### waveAmplitudeRampProgressMax

```
public float waveAmplitudeRampProgressMax
```

The normalized progress, at which the full wave amplitude will be ramped down.

### waveAmplitudeRampProgressMin

```
public float waveAmplitudeRampProgressMin
```

The normalized progress, at which the full wave amplitude will be ramped up.

### waveSpeed

```
public int waveSpeed
```

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

### wavelengthDeterminate

```
public int wavelengthDeterminate
```

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

### wavelengthIndeterminate

```
public int wavelengthIndeterminate
```

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

## Protected constructors

### BaseProgressIndicatorSpec

```
protected BaseProgressIndicatorSpec(
    Context context,
    AttributeSet attrs,
    int defStyleAttr,
    int defStyleRes
)
```

Instantiates BaseProgressIndicatorSpec.

If attributes are missing, the values defined in the default style Widget_MaterialComponents_ProgressIndicator will be loaded.

| Parameters |
|---|---|
| `Context context` | Current themed context. |
| `AttributeSet attrs` | Component's attributes set. |

## Public methods

### getTrackCornerRadiusInPx

```
public int getTrackCornerRadiusInPx()
```

Returns the track corner radius in pixels.

If `https://developer.android.com/reference/com/google/android/material/progressindicator/BaseProgressIndicatorSpec#useRelativeTrackCornerRadius()` is true, the track corner radius is calculated using the track thickness and the track corner radius fraction. Otherwise, the track corner radius is returned directly.

### hasWavyEffect

```
public boolean hasWavyEffect(boolean isDeterminate)
```

### isHideAnimationEnabled

```
public boolean isHideAnimationEnabled()
```

### isShowAnimationEnabled

```
public boolean isShowAnimationEnabled()
```

### 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.