NotificationCompat.ProgressStyle.Segment


class NotificationCompat.ProgressStyle.Segment


A segment of the progress bar, which defines its length and color. 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.

Summary

Public constructors

Segment(length: @IntRange(from = 1) Int)

Create a segment with a non-zero length.

Public functions

@ColorInt Int

Returns the color of this Segment.

Int

Gets the id of this Segment.

@IntRange(from = 1) Int

The length of this Segment within the progress bar.

NotificationCompat.ProgressStyle.Segment

Optional color of this Segment

NotificationCompat.ProgressStyle.Segment
setId(id: Int)

Optional ID used to uniquely identify the element across updates.

Public constructors

Segment

Added in 1.17.0-beta01
Segment(length: @IntRange(from = 1) Int)

Create a segment with a non-zero length.

Parameters
length: @IntRange(from = 1) Int

See getLength

Public functions

getColor

Added in 1.17.0-beta01
fun getColor(): @ColorInt Int

Returns the color of this Segment.

See also
setColor
COLOR_DEFAULT

for the default visual behavior when it is not set.

getId

Added in 1.17.0-beta01
fun getId(): Int

Gets the id of this Segment.

See also
setId

getLength

Added in 1.17.0-beta01
fun getLength(): @IntRange(from = 1) Int

The length of this Segment within the progress bar. This value has no units, it is just relative to the length of other segments, and the value provided to setProgress.

setColor

Added in 1.17.0-beta01
fun setColor(color: @ColorInt Int): NotificationCompat.ProgressStyle.Segment

Optional color of this Segment

setId

Added in 1.17.0-beta01
fun setId(id: Int): NotificationCompat.ProgressStyle.Segment

Optional ID used to uniquely identify the element across updates. The default is 0.