# BaseProgressIndicator

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

*** ** * ** ***


```
public abstract class BaseProgressIndicator<S extends BaseProgressIndicatorSpec>
```

<br />

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

|---|---|
| `https://developer.android.com/reference/com/google/android/material/progressindicator/CircularProgressIndicator` | This class implements the circular type progress indicators. |
| `https://developer.android.com/reference/com/google/android/material/progressindicator/LinearProgressIndicator` | This class implements the linear type progress indicators. |

*** ** * ** ***

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.

## Summary

| ### Constants |
|---|---|
| `static final int` | `https://developer.android.com/reference/com/google/android/material/progressindicator/BaseProgressIndicator#HIDE_ESCAPE() = 3` |
| `static final int` | `https://developer.android.com/reference/com/google/android/material/progressindicator/BaseProgressIndicator#HIDE_INWARD() = 2` |
| `static final int` | `https://developer.android.com/reference/com/google/android/material/progressindicator/BaseProgressIndicator#HIDE_NONE() = 0` |
| `static final int` | `https://developer.android.com/reference/com/google/android/material/progressindicator/BaseProgressIndicator#HIDE_OUTWARD() = 1` |
| `static final int` | `https://developer.android.com/reference/com/google/android/material/progressindicator/BaseProgressIndicator#SHOW_INWARD() = 2` |
| `static final int` | `https://developer.android.com/reference/com/google/android/material/progressindicator/BaseProgressIndicator#SHOW_NONE() = 0` |
| `static final int` | `https://developer.android.com/reference/com/google/android/material/progressindicator/BaseProgressIndicator#SHOW_OUTWARD() = 1` |

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

| ### Public methods |
|---|---|
| `Drawable` | `https://developer.android.com/reference/com/google/android/material/progressindicator/BaseProgressIndicator#getCurrentDrawable()()` Returns the corresponding drawable based on current indeterminate state. |
| `int` | `https://developer.android.com/reference/com/google/android/material/progressindicator/BaseProgressIndicator#getHideAnimationBehavior()()` Returns the hide animation behavior used in this progress indicator. |
| `https://developer.android.com/reference/com/google/android/material/progressindicator/IndeterminateDrawable<S>` | `https://developer.android.com/reference/com/google/android/material/progressindicator/BaseProgressIndicator#getIndeterminateDrawable()()` |
| `int[]` | `https://developer.android.com/reference/com/google/android/material/progressindicator/BaseProgressIndicator#getIndicatorColor()()` Returns the array of colors used in the indicator of this progress indicator. |
| `int` | `https://developer.android.com/reference/com/google/android/material/progressindicator/BaseProgressIndicator#getIndicatorTrackGapSize()()` Returns the size of the gap between the indicator and track in pixels. |
| `https://developer.android.com/reference/com/google/android/material/progressindicator/DeterminateDrawable<S>` | `https://developer.android.com/reference/com/google/android/material/progressindicator/BaseProgressIndicator#getProgressDrawable()()` |
| `int` | `https://developer.android.com/reference/com/google/android/material/progressindicator/BaseProgressIndicator#getShowAnimationBehavior()()` Returns the show animation behavior used in this progress indicator. |
| `int` | `https://developer.android.com/reference/com/google/android/material/progressindicator/BaseProgressIndicator#getTrackColor()()` Returns the color used in the track of this progress indicator. |
| `int` | `https://developer.android.com/reference/com/google/android/material/progressindicator/BaseProgressIndicator#getTrackCornerRadius()()` Returns the radius of the rounded corner for the indicator and track in pixels. |
| `float` | `https://developer.android.com/reference/com/google/android/material/progressindicator/BaseProgressIndicator#getTrackCornerRadiusFraction()()` Returns the relative radius of the rounded corner for the indicator and track in pixels. |
| `int` | `https://developer.android.com/reference/com/google/android/material/progressindicator/BaseProgressIndicator#getTrackThickness()()` Returns the track thickness of this progress indicator in pixels. |
| `int` | `https://developer.android.com/reference/com/google/android/material/progressindicator/BaseProgressIndicator#getWaveAmplitude()()` Returns the amplitude of the indicator's amplitude in pixels. |
| `int` | `https://developer.android.com/reference/com/google/android/material/progressindicator/BaseProgressIndicator#getWaveSpeed()()` Returns the speed of the indicator's waveform in pixels. |
| `int` | `https://developer.android.com/reference/com/google/android/material/progressindicator/BaseProgressIndicator#getWavelengthDeterminate()()` Returns the wavelength, in pixels, of the indicator's waveform in determinate mode. |
| `int` | `https://developer.android.com/reference/com/google/android/material/progressindicator/BaseProgressIndicator#getWavelengthIndeterminate()()` Returns the wavelength, in pixels, of the indicator's waveform in indeterminate mode. |
| `void` | `https://developer.android.com/reference/com/google/android/material/progressindicator/BaseProgressIndicator#hide()()` Hides the progress indicator. |
| `void` | `https://developer.android.com/reference/com/google/android/material/progressindicator/BaseProgressIndicator#invalidate()()` |
| `void` | `https://developer.android.com/reference/com/google/android/material/progressindicator/BaseProgressIndicator#setHideAfterMaxProgress(boolean)(boolean hideAfterMaxProgress)` |
| `void` | `https://developer.android.com/reference/com/google/android/material/progressindicator/BaseProgressIndicator#setHideAnimationBehavior(int)(int hideAnimationBehavior)` Sets the hide animation behavior used in this progress indicator. |
| `synchronized void` | `https://developer.android.com/reference/com/google/android/material/progressindicator/BaseProgressIndicator#setIndeterminate(boolean)(boolean indeterminate)` Sets the progress mode of the progress indicator. |
| `void` | `https://developer.android.com/reference/com/google/android/material/progressindicator/BaseProgressIndicator#setIndeterminateAnimatorDurationScale(float)( float indeterminateAnimatorDurationScale )` Sets the scale of the animation duration in indeterminate mode. |
| `void` | `https://developer.android.com/reference/com/google/android/material/progressindicator/BaseProgressIndicator#setIndeterminateDrawable(Drawable)(Drawable drawable)` Sets a new indeterminate drawable. |
| `void` | `https://developer.android.com/reference/com/google/android/material/progressindicator/BaseProgressIndicator#setIndicatorColor(int...)(int[] indicatorColors)` Sets the colors used in the indicator of this progress indicator. |
| `void` | `https://developer.android.com/reference/com/google/android/material/progressindicator/BaseProgressIndicator#setIndicatorTrackGapSize(int)(int indicatorTrackGapSize)` Sets the size of the gap between the indicator and track in pixels. |
| `synchronized void` | `https://developer.android.com/reference/com/google/android/material/progressindicator/BaseProgressIndicator#setProgress(int)(int progress)` Sets the current progress to the specified value. |
| `void` | `https://developer.android.com/reference/com/google/android/material/progressindicator/BaseProgressIndicator#setProgressCompat(int,boolean)(int progress, boolean animated)` Sets the current progress to the specified value with/without animation based on the input. |
| `void` | `https://developer.android.com/reference/com/google/android/material/progressindicator/BaseProgressIndicator#setProgressDrawable(Drawable)(Drawable drawable)` Sets a new progress drawable. |
| `void` | `https://developer.android.com/reference/com/google/android/material/progressindicator/BaseProgressIndicator#setShowAnimationBehavior(int)(int showAnimationBehavior)` Sets the show animation behavior used in this progress indicator. |
| `void` | `https://developer.android.com/reference/com/google/android/material/progressindicator/BaseProgressIndicator#setTrackColor(int)(int trackColor)` Sets the color of the track of this progress indicator. |
| `void` | `https://developer.android.com/reference/com/google/android/material/progressindicator/BaseProgressIndicator#setTrackCornerRadius(int)(int trackCornerRadius)` Sets the radius of the rounded corner for the indicator and track in pixels. |
| `void` | `https://developer.android.com/reference/com/google/android/material/progressindicator/BaseProgressIndicator#setTrackCornerRadiusFraction(float)(float fraction)` Sets the radius of the rounded corner for the indicator and track in fraction of track thickness. |
| `void` | `https://developer.android.com/reference/com/google/android/material/progressindicator/BaseProgressIndicator#setTrackThickness(int)(int trackThickness)` Sets the track thickness of this progress indicator. |
| `void` | `https://developer.android.com/reference/com/google/android/material/progressindicator/BaseProgressIndicator#setVisibilityAfterHide(int)(int visibility)` Sets the visibility which the component will be after hide animation finishes. |
| `void` | `https://developer.android.com/reference/com/google/android/material/progressindicator/BaseProgressIndicator#setWaveAmplitude(int)(int waveAmplitude)` Sets the amplitude of the indicator's amplitude in pixels. |
| `void` | `https://developer.android.com/reference/com/google/android/material/progressindicator/BaseProgressIndicator#setWaveAmplitudeRampProgressMax(float)(float progress)` Sets the progress for ramping down the full wave amplitude. |
| `void` | `https://developer.android.com/reference/com/google/android/material/progressindicator/BaseProgressIndicator#setWaveAmplitudeRampProgressMin(float)(float progress)` Sets the progress for ramping up the full wave amplitude. |
| `void` | `https://developer.android.com/reference/com/google/android/material/progressindicator/BaseProgressIndicator#setWaveSpeed(int)(int waveSpeed)` Sets the speed of the indicator's waveform in pixels. |
| `void` | `https://developer.android.com/reference/com/google/android/material/progressindicator/BaseProgressIndicator#setWavelength(int)(int wavelength)` Sets the wavelength of the indicator's determinate and indeterminate waveform in pixels. |
| `void` | `https://developer.android.com/reference/com/google/android/material/progressindicator/BaseProgressIndicator#setWavelengthDeterminate(int)(int wavelength)` Sets the wavelength, in pixels, of the indicator's waveform in indeterminate mode. |
| `void` | `https://developer.android.com/reference/com/google/android/material/progressindicator/BaseProgressIndicator#setWavelengthIndeterminate(int)(int wavelength)` Sets the wavelength, in pixels, of the indicator's waveform in indeterminate mode. |
| `void` | `https://developer.android.com/reference/com/google/android/material/progressindicator/BaseProgressIndicator#show()()` Shows the progress indicator. |

| ### Protected methods |
|---|---|
| `void` | `https://developer.android.com/reference/com/google/android/material/progressindicator/BaseProgressIndicator#applyNewVisibility(boolean)(boolean animate)` If it changes to visible, the start animation will be started if `showAnimationBehavior` indicates any. |
| `void` | `https://developer.android.com/reference/com/google/android/material/progressindicator/BaseProgressIndicator#onAttachedToWindow()()` |
| `void` | `https://developer.android.com/reference/com/google/android/material/progressindicator/BaseProgressIndicator#onDetachedFromWindow()()` |
| `synchronized void` | `https://developer.android.com/reference/com/google/android/material/progressindicator/BaseProgressIndicator#onDraw(Canvas)(Canvas canvas)` |
| `void` | `https://developer.android.com/reference/com/google/android/material/progressindicator/BaseProgressIndicator#onLayout(boolean,int,int,int,int)(boolean changed, int left, int top, int right, int bottom)` |
| `synchronized void` | `https://developer.android.com/reference/com/google/android/material/progressindicator/BaseProgressIndicator#onMeasure(int,int)(int widthMeasureSpec, int heightMeasureSpec)` |
| `void` | `https://developer.android.com/reference/com/google/android/material/progressindicator/BaseProgressIndicator#onVisibilityChanged(View,int)(View changedView, int visibility)` |
| `void` | `https://developer.android.com/reference/com/google/android/material/progressindicator/BaseProgressIndicator#onWindowVisibilityChanged(int)(int visibility)` |

## Constants

### HIDE_ESCAPE

```
public static final int HIDE_ESCAPE = 3
```

### HIDE_INWARD

```
public static final int HIDE_INWARD = 2
```

### HIDE_NONE

```
public static final int HIDE_NONE = 0
```

### HIDE_OUTWARD

```
public static final int HIDE_OUTWARD = 1
```

### SHOW_INWARD

```
public static final int SHOW_INWARD = 2
```

### SHOW_NONE

```
public static final int SHOW_NONE = 0
```

### SHOW_OUTWARD

```
public static final int SHOW_OUTWARD = 1
```

## Protected constructors

### BaseProgressIndicator

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

## Public methods

### getCurrentDrawable

```
public Drawable getCurrentDrawable()
```

Returns the corresponding drawable based on current indeterminate state.

### getHideAnimationBehavior

```
public int getHideAnimationBehavior()
```

Returns the hide animation behavior used in this progress indicator.

ref com.google.android.material.progressindicator.R.styleable#BaseProgressIndicator_hideAnimationBehavior

| See also |
|---|---|
| `https://developer.android.com/reference/com/google/android/material/progressindicator/BaseProgressIndicator#setHideAnimationBehavior(int)` |   |

### getIndeterminateDrawable

```
public IndeterminateDrawable<S> getIndeterminateDrawable()
```

### getIndicatorColor

```
public int[] getIndicatorColor()
```

Returns the array of colors used in the indicator of this progress indicator.

ref com.google.android.material.progressindicator.R.styleable#BaseProgressIndicator_indicatorColor

| See also |
|---|---|
| `https://developer.android.com/reference/com/google/android/material/progressindicator/BaseProgressIndicator#setIndicatorColor(int...)` |   |

### getIndicatorTrackGapSize

```
public int getIndicatorTrackGapSize()
```

Returns the size of the gap between the indicator and track in pixels.

ref com.google.android.material.progressindicator.R.styleable#BaseProgressIndicator_indicatorTrackGapSize

| See also |
|---|---|
| `https://developer.android.com/reference/com/google/android/material/progressindicator/BaseProgressIndicator#setIndicatorTrackGapSize(int)` |   |

### getProgressDrawable

```
public DeterminateDrawable<S> getProgressDrawable()
```

### getShowAnimationBehavior

```
public int getShowAnimationBehavior()
```

Returns the show animation behavior used in this progress indicator.

ref com.google.android.material.progressindicator.R.styleable#BaseProgressIndicator_showAnimationBehavior

| See also |
|---|---|
| `https://developer.android.com/reference/com/google/android/material/progressindicator/BaseProgressIndicator#setShowAnimationBehavior(int)` |   |

### getTrackColor

```
public int getTrackColor()
```

Returns the color used in the track of this progress indicator.

ref com.google.android.material.progressindicator.R.styleable#BaseProgressIndicator_trackColor

| See also |
|---|---|
| `https://developer.android.com/reference/com/google/android/material/progressindicator/BaseProgressIndicator#setTrackColor(int)` |   |

### getTrackCornerRadius

```
public int getTrackCornerRadius()
```

Returns the radius of the rounded corner for the indicator and track in pixels.

ref com.google.android.material.progressindicator.R.styleable#BaseProgressIndicator_trackCornerRadius

| See also |
|---|---|
| `https://developer.android.com/reference/com/google/android/material/progressindicator/BaseProgressIndicator#setTrackCornerRadius(int)` |   |

### getTrackCornerRadiusFraction

```
public float getTrackCornerRadiusFraction()
```

Returns the relative radius of the rounded corner for the indicator and track in pixels.

ref com.google.android.material.progressindicator.R.styleable#BaseProgressIndicator_trackCornerRadius

| See also |
|---|---|
| `https://developer.android.com/reference/com/google/android/material/progressindicator/BaseProgressIndicator#setTrackCornerRadiusFraction(float)` |   |

### getTrackThickness

```
public int getTrackThickness()
```

Returns the track thickness of this progress indicator in pixels.

ref com.google.android.material.progressindicator.R.styleable#BaseProgressIndicator_trackThickness

| See also |
|---|---|
| `https://developer.android.com/reference/com/google/android/material/progressindicator/BaseProgressIndicator#setTrackThickness(int)` |   |

### getWaveAmplitude

```
public int getWaveAmplitude()
```

Returns the amplitude of the indicator's amplitude in pixels.

| See also |
|---|---|
| `https://developer.android.com/reference/com/google/android/material/progressindicator/BaseProgressIndicator#setWaveAmplitude(int)` |   |

### getWaveSpeed

```
public int getWaveSpeed()
```

Returns the speed of the indicator's waveform in pixels.

| See also |
|---|---|
| `https://developer.android.com/reference/com/google/android/material/progressindicator/BaseProgressIndicator#setWaveSpeed(int)` |   |

### getWavelengthDeterminate

```
public int getWavelengthDeterminate()
```

Returns the wavelength, in pixels, of the indicator's waveform in determinate mode.

| See also |
|---|---|
| `https://developer.android.com/reference/com/google/android/material/progressindicator/BaseProgressIndicator#setWavelengthDeterminate(int)` |   |
| `https://developer.android.com/reference/com/google/android/material/progressindicator/BaseProgressIndicator#setWavelength(int)` |   |

### getWavelengthIndeterminate

```
public int getWavelengthIndeterminate()
```

Returns the wavelength, in pixels, of the indicator's waveform in indeterminate mode.

| See also |
|---|---|
| `https://developer.android.com/reference/com/google/android/material/progressindicator/BaseProgressIndicator#setWavelengthIndeterminate(int)` |   |
| `https://developer.android.com/reference/com/google/android/material/progressindicator/BaseProgressIndicator#setWavelength(int)` |   |

### hide

```
public void hide()
```

Hides the progress indicator. If `minHideDelay` has been set to a positive value, wait until the delay elapsed before starting the hide action. Otherwise start hiding immediately.

### invalidate

```
public void invalidate()
```

### setHideAfterMaxProgress

```
public void setHideAfterMaxProgress(boolean hideAfterMaxProgress)
```

### setHideAnimationBehavior

```
public void setHideAnimationBehavior(int hideAnimationBehavior)
```

Sets the hide animation behavior used in this progress indicator.

ref com.google.android.material.progressindicator.R.styleable#BaseProgressIndicator_hideAnimationBehavior

| Parameters |
|---|---|
| `int hideAnimationBehavior` | The new behavior of hide animation. |

| See also |
|---|---|
| `https://developer.android.com/reference/com/google/android/material/progressindicator/BaseProgressIndicator#getHideAnimationBehavior()` |   |

### setIndeterminate

```
synchronized public void setIndeterminate(boolean indeterminate)
```

Sets the progress mode of the progress indicator. Will throw an `https://developer.android.com/reference/java/lang/IllegalStateException` if the progress indicator is visible.

| Parameters |
|---|---|
| `boolean indeterminate` | Whether the progress indicator should be in indeterminate mode. |

### setIndeterminateAnimatorDurationScale

```
public void setIndeterminateAnimatorDurationScale(
    float indeterminateAnimatorDurationScale
)
```

Sets the scale of the animation duration in indeterminate mode.

ref com.google.android.material.progressindicator.R.styleable#BaseProgressIndicator_indeterminateAnimatorDurationScale

| Parameters |
|---|---|
| `float indeterminateAnimatorDurationScale` | The new scale of the animation duration in indeterminate mode. |

### setIndeterminateDrawable

```
public void setIndeterminateDrawable(Drawable drawable)
```

Sets a new indeterminate drawable. It has to inherit from `https://developer.android.com/reference/com/google/android/material/progressindicator/IndeterminateDrawable`.

| Parameters |
|---|---|
| `Drawable drawable` | The new indeterminate drawable. |

| Throws |
|---|---|
| `https://developer.android.com/reference/java/lang/IllegalArgumentException` | if a framework drawable is passed in. |

### setIndicatorColor

```
public void setIndicatorColor(int[] indicatorColors)
```

Sets the colors used in the indicator of this progress indicator.

ref com.google.android.material.progressindicator.R.styleable#BaseProgressIndicator_indicatorColor

| Parameters |
|---|---|
| `int[] indicatorColors` | The new colors used in indicator. |

| See also |
|---|---|
| `https://developer.android.com/reference/com/google/android/material/progressindicator/BaseProgressIndicator#getIndicatorColor()` |   |

### setIndicatorTrackGapSize

```
public void setIndicatorTrackGapSize(int indicatorTrackGapSize)
```

Sets the size of the gap between the indicator and track in pixels.

ref com.google.android.material.progressindicator.R.styleable#BaseProgressIndicator_indicatorTrackGapSize

| Parameters |
|---|---|
| `int indicatorTrackGapSize` | The new gap size in pixels. |

| See also |
|---|---|
| `https://developer.android.com/reference/com/google/android/material/progressindicator/BaseProgressIndicator#getIndicatorTrackGapSize()` |   |

### setProgress

```
synchronized public void setProgress(int progress)
```

Sets the current progress to the specified value. Does not do anything if the progress bar is in indeterminate mode. Animation is not used by default. This default setting is aligned with setProgress.

| Parameters |
|---|---|
| `int progress` | The new progress value. |

| See also |
|---|---|
| `https://developer.android.com/reference/ProgressBar#setProgress(int)` |   |
| `https://developer.android.com/reference/com/google/android/material/progressindicator/BaseProgressIndicator#setProgressCompat(int,boolean)` |   |

### setProgressCompat

```
public void setProgressCompat(int progress, boolean animated)
```

Sets the current progress to the specified value with/without animation based on the input.

If it's in the indeterminate mode, it will smoothly transition to determinate mode by finishing the current indeterminate animation cycle.

| Parameters |
|---|---|
| `int progress` | The new progress value. |
| `boolean animated` | Whether to update the progress with the animation. |

| See also |
|---|---|
| `https://developer.android.com/reference/com/google/android/material/progressindicator/BaseProgressIndicator#setProgress(int)` |   |

### setProgressDrawable

```
public void setProgressDrawable(Drawable drawable)
```

Sets a new progress drawable. It has to inherit from `https://developer.android.com/reference/com/google/android/material/progressindicator/DeterminateDrawable`.

| Parameters |
|---|---|
| `Drawable drawable` | The new progress drawable. |

| Throws |
|---|---|
| `https://developer.android.com/reference/java/lang/IllegalArgumentException` | if a framework drawable is passed in. |

### setShowAnimationBehavior

```
public void setShowAnimationBehavior(int showAnimationBehavior)
```

Sets the show animation behavior used in this progress indicator.

ref com.google.android.material.progressindicator.R.styleable#BaseProgressIndicator_showAnimationBehavior

| Parameters |
|---|---|
| `int showAnimationBehavior` | The new behavior of show animation. |

| See also |
|---|---|
| `https://developer.android.com/reference/com/google/android/material/progressindicator/BaseProgressIndicator#getShowAnimationBehavior()` |   |

### setTrackColor

```
public void setTrackColor(int trackColor)
```

Sets the color of the track of this progress indicator.

ref com.google.android.material.progressindicator.R.styleable#BaseProgressIndicator_trackColor

| Parameters |
|---|---|
| `int trackColor` | The new color used in the track of this progress indicator. |

| See also |
|---|---|
| `https://developer.android.com/reference/com/google/android/material/progressindicator/BaseProgressIndicator#getTrackColor()` |   |

### setTrackCornerRadius

```
public void setTrackCornerRadius(int trackCornerRadius)
```

Sets the radius of the rounded corner for the indicator and track in pixels.

ref com.google.android.material.progressindicator.R.styleable#BaseProgressIndicator_trackCornerRadius

| Parameters |
|---|---|
| `int trackCornerRadius` | The new corner radius in pixels. |

| See also |
|---|---|
| `https://developer.android.com/reference/com/google/android/material/progressindicator/BaseProgressIndicator#getTrackCornerRadius()` |   |

### setTrackCornerRadiusFraction

```
public void setTrackCornerRadiusFraction(float fraction)
```

Sets the radius of the rounded corner for the indicator and track in fraction of track thickness.

ref com.google.android.material.progressindicator.R.styleable#BaseProgressIndicator_trackCornerRadius

| Parameters |
|---|---|
| `float fraction` | The fraction of corner radius to track thickness. |

| See also |
|---|---|
| `https://developer.android.com/reference/com/google/android/material/progressindicator/BaseProgressIndicator#getTrackCornerRadiusFraction()` |   |

### setTrackThickness

```
public void setTrackThickness(int trackThickness)
```

Sets the track thickness of this progress indicator.

ref com.google.android.material.progressindicator.R.styleable#BaseProgressIndicator_trackThickness

| Parameters |
|---|---|
| `int trackThickness` | The new track/indicator thickness in pixels. |

| See also |
|---|---|
| `https://developer.android.com/reference/com/google/android/material/progressindicator/BaseProgressIndicator#getTrackThickness()` |   |

### setVisibilityAfterHide

```
public void setVisibilityAfterHide(int visibility)
```

Sets the visibility which the component will be after hide animation finishes.

| Parameters |
|---|---|
| `int visibility` | New component's visibility after the hide animation finishes. |

### setWaveAmplitude

```
public void setWaveAmplitude(int waveAmplitude)
```

Sets the amplitude of the indicator's amplitude in pixels.

| Parameters |
|---|---|
| `int waveAmplitude` | The new amplitude in pixels. |

| See also |
|---|---|
| `https://developer.android.com/reference/com/google/android/material/progressindicator/BaseProgressIndicator#getWaveAmplitude()` |   |

### setWaveAmplitudeRampProgressMax

```
public void setWaveAmplitudeRampProgressMax(float progress)
```

Sets the progress for ramping down the full wave amplitude. If progress is outside the range, track is flat.

| Parameters |
|---|---|
| `float progress` | The progress to ramp down wave amplitude. |

### setWaveAmplitudeRampProgressMin

```
public void setWaveAmplitudeRampProgressMin(float progress)
```

Sets the progress for ramping up the full wave amplitude. If progress is outside the range, track is flat.

| Parameters |
|---|---|
| `float progress` | The progress to ramp up wave amplitude. |

### setWaveSpeed

```
public void setWaveSpeed(int waveSpeed)
```

Sets the speed of the indicator's waveform in pixels.

| Parameters |
|---|---|
| `int waveSpeed` | The new speed in pixels. |

| See also |
|---|---|
| `https://developer.android.com/reference/com/google/android/material/progressindicator/BaseProgressIndicator#getWaveSpeed()` |   |

### setWavelength

```
public void setWavelength(int wavelength)
```

Sets the wavelength of the indicator's determinate and indeterminate waveform in pixels.

| Parameters |
|---|---|
| `int wavelength` | The new wavelength in pixels. No waves are drawn, if it equals to 0. |

| See also |
|---|---|
| `https://developer.android.com/reference/com/google/android/material/progressindicator/BaseProgressIndicator#getWavelengthDeterminate()` |   |
| `https://developer.android.com/reference/com/google/android/material/progressindicator/BaseProgressIndicator#getWavelengthIndeterminate()` |   |

### setWavelengthDeterminate

```
public void setWavelengthDeterminate(int wavelength)
```

Sets the wavelength, in pixels, of the indicator's waveform in indeterminate mode.

| Parameters |
|---|---|
| `int wavelength` | The new wavelength in pixels. No waves are drawn when wavelength is zero. |

| See also |
|---|---|
| `https://developer.android.com/reference/com/google/android/material/progressindicator/BaseProgressIndicator#getWavelengthDeterminate()` |   |

### setWavelengthIndeterminate

```
public void setWavelengthIndeterminate(int wavelength)
```

Sets the wavelength, in pixels, of the indicator's waveform in indeterminate mode.

| Parameters |
|---|---|
| `int wavelength` | The new wavelength in pixels. No waves are drawn when wavelength is zero. |

| See also |
|---|---|
| `https://developer.android.com/reference/com/google/android/material/progressindicator/BaseProgressIndicator#getWavelengthIndeterminate()` |   |

### show

```
public void show()
```

Shows the progress indicator. If `showDelay` has been set to a positive value, wait until the delay elapsed before starting the show action. Otherwise start showing immediately.

## Protected methods

### applyNewVisibility

```
protected void applyNewVisibility(boolean animate)
```

If it changes to visible, the start animation will be started if `showAnimationBehavior` indicates any. If it changes to invisible, hides the drawable immediately.

| Parameters |
|---|---|
| `boolean animate` | Whether to change the visibility with animation. |

### onAttachedToWindow

```
protected void onAttachedToWindow()
```

### onDetachedFromWindow

```
protected void onDetachedFromWindow()
```

### onDraw

```
synchronized protected void onDraw(Canvas canvas)
```

### onLayout

```
protected void onLayout(boolean changed, int left, int top, int right, int bottom)
```

### onMeasure

```
synchronized protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec)
```

### onVisibilityChanged

```
protected void onVisibilityChanged(View changedView, int visibility)
```

### onWindowVisibilityChanged

```
protected void onWindowVisibilityChanged(int visibility)
```