Added in [API level 36](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels) Summary: [Nested Classes](https://developer.android.com/reference/android/app/Notification.ProgressStyle#nestedclasses) \| [Inherited Fields](https://developer.android.com/reference/android/app/Notification.ProgressStyle#inhfields) \| [Ctors](https://developer.android.com/reference/android/app/Notification.ProgressStyle#pubctors) \| [Methods](https://developer.android.com/reference/android/app/Notification.ProgressStyle#pubmethods) \| [Inherited Methods](https://developer.android.com/reference/android/app/Notification.ProgressStyle#inhmethods)

# Notification.ProgressStyle

*** ** * ** ***


`
public
static


class
Notification.ProgressStyle
`


`


`

`

extends https://developer.android.com/reference/android/app/Notification.Style


`

`


`

|---|---|---|
| [java.lang.Object](https://developer.android.com/reference/java/lang/Object) |||
| ↳ | [android.app.Notification.Style](https://developer.android.com/reference/android/app/Notification.Style) ||
|   | ↳ | android.app.Notification.ProgressStyle |

<br />

*** ** * ** ***

A Notification Style used to define a notification whose expanded state includes
a highly customizable progress bar with segments, points, a custom tracker icon,
and custom icons at the start and end of the progress bar.

This style is suggested for use cases where the app is showing a tracker to the
user of a thing they are interested in: the location of a car on its way
to pick them up, food being delivered, or their own progress in a navigation
journey.

To use this style with your Notification, feed it to
`https://developer.android.com/reference/android/app/Notification.Builder#setStyle(android.app.Notification.Style)` like so:

```
new Notification.Builder(context)
  .setSmallIcon(R.drawable.ic_notification)
  .setColor(Color.GREEN)
  .setColorized(true)
  .setContentTitle("Arrive 10:08 AM").
  .setContentText("Dominique Ansel Bakery Soho")
  .addAction(new Notification.Action("Exit navigation",...))
  .setStyle(new Notification.ProgressStyle()
      .setStyledByProgress(false)
      .setProgress(456)
      .setProgressTrackerIcon(Icon.createWithResource(R.drawable.ic_driving_tracker))
      .addProgressSegment(new Segment(41).setColor(Color.BLACK))
      .addProgressSegment(new Segment(552).setColor(Color.YELLOW))
      .addProgressSegment(new Segment(253).setColor(Color.YELLOW))
      .addProgressSegment(new Segment(94).setColor(Color.BLUE))
      .addProgressPoint(new Point(60).setColor(Color.RED))
      .addProgressPoint(new Point(560).setColor(Color.YELLOW))
  )
```


NOTE: The progress bar layout will be mirrored for RTL layout.


NOTE: The extras set by `https://developer.android.com/reference/android/app/Notification.Builder#setProgress(int,%20int,%20boolean)` will be overridden by
the values set on this style object when the notification is built. Therefore, that method
is not used with this style.

<br />

## Summary

| ### Nested classes ||
|---|---|
| ` class` | `https://developer.android.com/reference/android/app/Notification.ProgressStyle.Point` A point within the progress bar, defining its position and color. |
| ` class` | `https://developer.android.com/reference/android/app/Notification.ProgressStyle.Segment` A segment of the progress bar, which defines its length and color. |

### Inherited fields

From class `https://developer.android.com/reference/android/app/Notification.Style` `
protected


https://developer.android.com/reference/android/app/Notification.Builder` `https://developer.android.com/reference/android/app/Notification.Style#mBuilder`


| ### Public constructors ||
|---|---|
| ` https://developer.android.com/reference/android/app/Notification.ProgressStyle#ProgressStyle()() ` |

| ### Public methods ||
|---|---|
| ` https://developer.android.com/reference/android/app/Notification.ProgressStyle` | ` https://developer.android.com/reference/android/app/Notification.ProgressStyle#addProgressPoint(android.app.Notification.ProgressStyle.Point)(https://developer.android.com/reference/android/app/Notification.ProgressStyle.Point point) ` Adds another point. |
| ` https://developer.android.com/reference/android/app/Notification.ProgressStyle` | ` https://developer.android.com/reference/android/app/Notification.ProgressStyle#addProgressSegment(android.app.Notification.ProgressStyle.Segment)(https://developer.android.com/reference/android/app/Notification.ProgressStyle.Segment segment) ` Appends a segment to the end of the progress bar. |
| ` int` | ` https://developer.android.com/reference/android/app/Notification.ProgressStyle#getProgress()() ` Gets the progress value of the progress bar. |
| ` https://developer.android.com/reference/android/graphics/drawable/Icon` | ` https://developer.android.com/reference/android/app/Notification.ProgressStyle#getProgressEndIcon()() ` Gets the progress bar end icon. |
| ` int` | ` https://developer.android.com/reference/android/app/Notification.ProgressStyle#getProgressMax()() ` Gets the sum of the lengths of all Segments in the style, which defines the maximum progress. |
| ` https://developer.android.com/reference/java/util/List<https://developer.android.com/reference/android/app/Notification.ProgressStyle.Point>` | ` https://developer.android.com/reference/android/app/Notification.ProgressStyle#getProgressPoints()() ` Gets the points that are displayed on the progress bar. |
| ` https://developer.android.com/reference/java/util/List<https://developer.android.com/reference/android/app/Notification.ProgressStyle.Segment>` | ` https://developer.android.com/reference/android/app/Notification.ProgressStyle#getProgressSegments()() ` Gets the segments that define the background layer of the progress bar. |
| ` https://developer.android.com/reference/android/graphics/drawable/Icon` | ` https://developer.android.com/reference/android/app/Notification.ProgressStyle#getProgressStartIcon()() ` Gets the progress bar start icon. |
| ` https://developer.android.com/reference/android/graphics/drawable/Icon` | ` https://developer.android.com/reference/android/app/Notification.ProgressStyle#getProgressTrackerIcon()() ` Gets the progress tracker icon for the progress bar. |
| ` boolean` | ` https://developer.android.com/reference/android/app/Notification.ProgressStyle#isProgressIndeterminate()() ` Get indeterminate value of the progress bar. |
| ` boolean` | ` https://developer.android.com/reference/android/app/Notification.ProgressStyle#isStyledByProgress()() ` Gets whether the progress bar's style is based on its progress. |
| ` https://developer.android.com/reference/android/app/Notification.ProgressStyle` | ` https://developer.android.com/reference/android/app/Notification.ProgressStyle#setProgress(int)(int progress) ` Specifies the progress (in the same units as `https://developer.android.com/reference/android/app/Notification.ProgressStyle.Segment#getLength()`) of the tracker along the length of the bar. |
| ` https://developer.android.com/reference/android/app/Notification.ProgressStyle` | ` https://developer.android.com/reference/android/app/Notification.ProgressStyle#setProgressEndIcon(android.graphics.drawable.Icon)(https://developer.android.com/reference/android/graphics/drawable/Icon endIcon) ` An optional square icon that appears at the end of the progress bar. |
| ` https://developer.android.com/reference/android/app/Notification.ProgressStyle` | ` https://developer.android.com/reference/android/app/Notification.ProgressStyle#setProgressIndeterminate(boolean)(boolean indeterminate) ` Used to indicate an initialization state without a known progress amount. |
| ` https://developer.android.com/reference/android/app/Notification.ProgressStyle` | ` https://developer.android.com/reference/android/app/Notification.ProgressStyle#setProgressPoints(java.util.List<android.app.Notification.ProgressStyle.Point>)(https://developer.android.com/reference/java/util/List<https://developer.android.com/reference/android/app/Notification.ProgressStyle.Point> points) ` Replaces all the progress points. |
| ` https://developer.android.com/reference/android/app/Notification.ProgressStyle` | ` https://developer.android.com/reference/android/app/Notification.ProgressStyle#setProgressSegments(java.util.List<android.app.Notification.ProgressStyle.Segment>)(https://developer.android.com/reference/java/util/List<https://developer.android.com/reference/android/app/Notification.ProgressStyle.Segment> progressSegments) ` Sets or replaces the segments of the progress bar. |
| ` https://developer.android.com/reference/android/app/Notification.ProgressStyle` | ` https://developer.android.com/reference/android/app/Notification.ProgressStyle#setProgressStartIcon(android.graphics.drawable.Icon)(https://developer.android.com/reference/android/graphics/drawable/Icon startIcon) ` An optional square icon that appears at the start of the progress bar. |
| ` https://developer.android.com/reference/android/app/Notification.ProgressStyle` | ` https://developer.android.com/reference/android/app/Notification.ProgressStyle#setProgressTrackerIcon(android.graphics.drawable.Icon)(https://developer.android.com/reference/android/graphics/drawable/Icon trackerIcon) ` An optional icon that can appear as an overlay on the bar at the point of current progress. |
| ` https://developer.android.com/reference/android/app/Notification.ProgressStyle` | ` https://developer.android.com/reference/android/app/Notification.ProgressStyle#setStyledByProgress(boolean)(boolean enabled) ` Indicates whether the segments and points will be styled differently based on whether they are behind or ahead of the current progress. |

### Inherited methods

From class `

https://developer.android.com/reference/android/app/Notification.Style

` `


https://developer.android.com/reference/android/app/Notification` `
https://developer.android.com/reference/android/app/Notification.Style#build()()
`

Calls `https://developer.android.com/reference/android/app/Notification.Builder#build()` on the Builder this Style is
attached to.


`


void` `
https://developer.android.com/reference/android/app/Notification.Style#checkBuilder()()
` `


https://developer.android.com/reference/android/widget/RemoteViews` `
https://developer.android.com/reference/android/app/Notification.Style#getStandardView(int)(int layoutId)
` `


void` `
https://developer.android.com/reference/android/app/Notification.Style#internalSetBigContentTitle(java.lang.CharSequence)(https://developer.android.com/reference/java/lang/CharSequence title)
`

Overrides ContentTitle in the expanded form of the template.


`


void` `
https://developer.android.com/reference/android/app/Notification.Style#internalSetSummaryText(java.lang.CharSequence)(https://developer.android.com/reference/java/lang/CharSequence cs)
`

Set the first line of text after the detail section in the expanded form of the template.


`


void` `
https://developer.android.com/reference/android/app/Notification.Style#setBuilder(android.app.Notification.Builder)(https://developer.android.com/reference/android/app/Notification.Builder builder)
` From class `

https://developer.android.com/reference/java/lang/Object

` `


https://developer.android.com/reference/java/lang/Object` `
https://developer.android.com/reference/java/lang/Object#clone()()
`

Creates and returns a copy of this object.


`


boolean` `
https://developer.android.com/reference/java/lang/Object#equals(java.lang.Object)(https://developer.android.com/reference/java/lang/Object obj)
`

Indicates whether some other object is "equal to" this one.


`


void` `
https://developer.android.com/reference/java/lang/Object#finalize()()
`

Called by the garbage collector on an object when garbage collection
determines that there are no more references to the object.


`


final

https://developer.android.com/reference/java/lang/Class<?>` `
https://developer.android.com/reference/java/lang/Object#getClass()()
`

Returns the runtime class of this `Object`.


`


int` `
https://developer.android.com/reference/java/lang/Object#hashCode()()
`

Returns a hash code value for the object.


`


final

void` `
https://developer.android.com/reference/java/lang/Object#notify()()
`

Wakes up a single thread that is waiting on this object's
monitor.


`


final

void` `
https://developer.android.com/reference/java/lang/Object#notifyAll()()
`

Wakes up all threads that are waiting on this object's monitor.


`


https://developer.android.com/reference/java/lang/String` `
https://developer.android.com/reference/java/lang/Object#toString()()
`

Returns a string representation of the object.


`


final

void` `
https://developer.android.com/reference/java/lang/Object#wait(long,%20int)(long timeoutMillis, int nanos)
`

Causes the current thread to wait until it is awakened, typically
by being *notified* or *interrupted*, or until a
certain amount of real time has elapsed.


`


final

void` `
https://developer.android.com/reference/java/lang/Object#wait(long)(long timeoutMillis)
`

Causes the current thread to wait until it is awakened, typically
by being *notified* or *interrupted*, or until a
certain amount of real time has elapsed.


`


final

void` `
https://developer.android.com/reference/java/lang/Object#wait()()
`

Causes the current thread to wait until it is awakened, typically
by being *notified* or *interrupted*.


## Public constructors

### ProgressStyle

```
public ProgressStyle ()
```

<br />

<br />

## Public methods

### addProgressPoint

Added in [API level 36](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public Notification.ProgressStyle addProgressPoint (Notification.ProgressStyle.Point point)
```

Adds another point.

Points within a progress bar are used to visualize distinct stages or milestones.
For example, you might use points to mark stops in a multi-stop
navigation journey, where each point represents a destination.

Points can be added in any order, as their
position within the progress bar is determined by their individual
`https://developer.android.com/reference/android/app/Notification.ProgressStyle.Point#getPosition()`.

<br />

| Parameters ||
|---|---|
| `point` | `Notification.ProgressStyle.Point`: This value cannot be `null`. <br /> |

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/app/Notification.ProgressStyle` | This value cannot be `null`. <br /> |

### addProgressSegment

Added in [API level 36](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public Notification.ProgressStyle addProgressSegment (Notification.ProgressStyle.Segment segment)
```

Appends a segment to the end of the progress bar.

Segments allow for creating progress bars with multiple colors or sections
to represent different stages or categories of progress.
For example, Traffic conditions along a navigation journey.

<br />

| Parameters ||
|---|---|
| `segment` | `Notification.ProgressStyle.Segment`: This value cannot be `null`. <br /> |

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/app/Notification.ProgressStyle` | This value cannot be `null`. <br /> |

### getProgress

Added in [API level 36](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public int getProgress ()
```

Gets the progress value of the progress bar.

<br />

| Returns ||
|---|---|
| `int` | Value is 0 or greater <br /> |

**See also:**

- `https://developer.android.com/reference/android/app/Notification.ProgressStyle#setProgress(int)`

### getProgressEndIcon

Added in [API level 36](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public Icon getProgressEndIcon ()
```

Gets the progress bar end icon.

<br />

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/graphics/drawable/Icon` | This value may be `null`. <br /> |

**See also:**

- `https://developer.android.com/reference/android/app/Notification.ProgressStyle#setProgressEndIcon(android.graphics.drawable.Icon)`

### getProgressMax

Added in [API level 36](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public int getProgressMax ()
```

Gets the sum of the lengths of all Segments in the style, which
defines the maximum progress. Defaults to 100 when segments are omitted.

<br />

| Returns ||
|---|---|
| `int` | Value is 0 or greater <br /> |

### getProgressPoints

Added in [API level 36](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public List<Notification.ProgressStyle.Point> getProgressPoints ()
```

Gets the points that are displayed on the progress bar.
.

<br />

| Returns ||
|---|---|
| `https://developer.android.com/reference/java/util/List<https://developer.android.com/reference/android/app/Notification.ProgressStyle.Point>` | This value cannot be `null`. <br /> |

**See also:**

- `https://developer.android.com/reference/android/app/Notification.ProgressStyle#setProgressPoints(java.util.List<android.app.Notification.ProgressStyle.Point>)`
- `https://developer.android.com/reference/android/app/Notification.ProgressStyle#addProgressPoint(android.app.Notification.ProgressStyle.Point)`

### getProgressSegments

Added in [API level 36](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public List<Notification.ProgressStyle.Segment> getProgressSegments ()
```

Gets the segments that define the background layer of the progress bar.

If no segments are provided, the progress bar will be rendered with a single segment
with length 100 and default color.

<br />

| Returns ||
|---|---|
| `https://developer.android.com/reference/java/util/List<https://developer.android.com/reference/android/app/Notification.ProgressStyle.Segment>` | This value cannot be `null`. <br /> |

**See also:**

- `https://developer.android.com/reference/android/app/Notification.ProgressStyle#setProgressSegments(java.util.List<android.app.Notification.ProgressStyle.Segment>)`
- `https://developer.android.com/reference/android/app/Notification.ProgressStyle#addProgressSegment(android.app.Notification.ProgressStyle.Segment)`

### getProgressStartIcon

Added in [API level 36](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public Icon getProgressStartIcon ()
```

Gets the progress bar start icon.

<br />

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/graphics/drawable/Icon` | This value may be `null`. <br /> |

**See also:**

- `https://developer.android.com/reference/android/app/Notification.ProgressStyle#setProgressStartIcon(android.graphics.drawable.Icon)`

### getProgressTrackerIcon

Added in [API level 36](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public Icon getProgressTrackerIcon ()
```

Gets the progress tracker icon for the progress bar.

<br />

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/graphics/drawable/Icon` | This value may be `null`. <br /> |

**See also:**

- `https://developer.android.com/reference/android/app/Notification.ProgressStyle#setProgressTrackerIcon(android.graphics.drawable.Icon)`

### isProgressIndeterminate

Added in [API level 36](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public boolean isProgressIndeterminate ()
```

Get indeterminate value of the progress bar.

<br />

| Returns ||
|---|---|
| `boolean` | <br /> |

**See also:**

- `https://developer.android.com/reference/android/app/Notification.ProgressStyle#setProgressIndeterminate(boolean)`

### isStyledByProgress

Added in [API level 36](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public boolean isStyledByProgress ()
```

Gets whether the progress bar's style is based on its progress.

<br />

| Returns ||
|---|---|
| `boolean` | <br /> |

**See also:**

- `https://developer.android.com/reference/android/app/Notification.ProgressStyle#setStyledByProgress(boolean)`

### setProgress

Added in [API level 36](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public Notification.ProgressStyle setProgress (int progress)
```

Specifies the progress (in the same units as `https://developer.android.com/reference/android/app/Notification.ProgressStyle.Segment#getLength()`)
of the tracker along the length of the bar.

The max progress value is the sum of all Segment lengths.
The default value is 0.

<br />

| Parameters ||
|---|---|
| `progress` | `int`: Value is 0 or greater <br /> |

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/app/Notification.ProgressStyle` | This value cannot be `null`. <br /> |

### setProgressEndIcon

Added in [API level 36](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public Notification.ProgressStyle setProgressEndIcon (Icon endIcon)
```

An optional square icon that appears at the end of the progress bar.
This icon will be cropped to its central square.
This icon will NOT be mirrored in RTL layouts.

<br />

| Parameters ||
|---|---|
| `endIcon` | `Icon`: This value may be `null`. <br /> |

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/app/Notification.ProgressStyle` | This value cannot be `null`. <br /> |

### setProgressIndeterminate

Added in [API level 36](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public Notification.ProgressStyle setProgressIndeterminate (boolean indeterminate)
```

Used to indicate an initialization state without a known progress amount.
When specified, the following fields are ignored:

<br />

| Parameters ||
|---|---|
| `indeterminate` | `boolean` <br /> |

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/app/Notification.ProgressStyle` | This value cannot be `null`. <br /> |

**See also:**

- `https://developer.android.com/reference/android/app/Notification.ProgressStyle#setProgress(int)`
- `https://developer.android.com/reference/android/app/Notification.ProgressStyle#setProgressSegments(java.util.List<android.app.Notification.ProgressStyle.Segment>)`
- `https://developer.android.com/reference/android/app/Notification.ProgressStyle#setProgressPoints(java.util.List<android.app.Notification.ProgressStyle.Point>)`
- `https://developer.android.com/reference/android/app/Notification.ProgressStyle#setProgressTrackerIcon(android.graphics.drawable.Icon)`
- `https://developer.android.com/reference/android/app/Notification.ProgressStyle#setStyledByProgress(boolean)`

### setProgressPoints

Added in [API level 36](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public Notification.ProgressStyle setProgressPoints (List<Notification.ProgressStyle.Point> points)
```

Replaces all the progress points.

Points within a progress bar are used to visualize distinct stages or milestones.
For example, you might use points to mark stops in a multi-stop
navigation journey, where each point represents a destination.

<br />

| Parameters ||
|---|---|
| `points` | `List`: This value cannot be `null`. <br /> |

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/app/Notification.ProgressStyle` | This value cannot be `null`. <br /> |

### setProgressSegments

Added in [API level 36](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public Notification.ProgressStyle setProgressSegments (List<Notification.ProgressStyle.Segment> progressSegments)
```

Sets or replaces the segments of the progress bar.

Segments allow for creating progress bars with multiple colors or sections
to represent different stages or categories of progress.
For example, Traffic conditions along a navigation journey.

<br />

| Parameters ||
|---|---|
| `progressSegments` | `List`: This value cannot be `null`. <br /> |

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/app/Notification.ProgressStyle` | This value cannot be `null`. <br /> |

### setProgressStartIcon

Added in [API level 36](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public Notification.ProgressStyle setProgressStartIcon (Icon startIcon)
```

An optional square icon that appears at the start of the progress bar.
This icon will be cropped to its central square.
This icon will NOT be mirrored in RTL layouts.

<br />

| Parameters ||
|---|---|
| `startIcon` | `Icon`: This value may be `null`. <br /> |

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/app/Notification.ProgressStyle` | This value cannot be `null`. <br /> |

### setProgressTrackerIcon

Added in [API level 36](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public Notification.ProgressStyle setProgressTrackerIcon (Icon trackerIcon)
```

An optional icon that can appear as an overlay on the bar at the point of
current progress.
Aspect ratio may be anywhere from 2:1 to 1:2; content outside that
aspect ratio range will be cropped.
This icon will be mirrored in RTL.

<br />

| Parameters ||
|---|---|
| `trackerIcon` | `Icon`: This value may be `null`. <br /> |

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/app/Notification.ProgressStyle` | This value cannot be `null`. <br /> |

### setStyledByProgress

Added in [API level 36](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public Notification.ProgressStyle setStyledByProgress (boolean enabled)
```

Indicates whether the segments and points will be styled differently
based on whether they are behind or ahead of the current progress.
When `true`, segments appearing ahead of the current progress will be given a
slightly different appearance to indicate that it is part of the progress bar
that is not "filled".
When `false`, all segments will be given the filled appearance, and it will be
the app's responsibility to use #setProgressTrackerIcon or segment colors
to make the current progress clear to the user.
the default value is `true`.

<br />

| Parameters ||
|---|---|
| `enabled` | `boolean` <br /> |

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/app/Notification.ProgressStyle` | This value cannot be `null`. <br /> |