Segment
class Segment
kotlin.Any | |
↳ | android.app.Notification.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 | |
---|---|
Create a segment with a non-zero length. |
Public methods | |
---|---|
Boolean |
Needed for android. |
Int |
getColor() Returns the color of this Segment. |
Int |
getId() Gets the id of this Segment. |
Int |
The length of this Segment within the progress bar. |
Int |
hashCode() |
Notification.ProgressStyle.Segment |
Optional color of this Segment |
Notification.ProgressStyle.Segment |
Optional ID used to uniquely identify the element across updates. |
Public constructors
Segment
Segment(length: Int)
Create a segment with a non-zero length.
Parameters | |
---|---|
length |
Int: See getLength |
Public methods
equals
fun equals(other: Any?): Boolean
Needed for android.app.Notification.Style#areNotificationsVisiblyDifferent
Parameters | |
---|---|
obj |
the reference object with which to compare. |
Return | |
---|---|
Boolean |
true if this object is the same as the obj argument; false otherwise. |
getLength
fun getLength(): 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 ProgressStyle.setProgress
.
hashCode
fun hashCode(): Int
Return | |
---|---|
Int |
a hash code value for this object. |
setColor
fun setColor(color: Int): Notification.ProgressStyle.Segment
Optional color of this Segment
Return | |
---|---|
Notification.ProgressStyle.Segment |
This value cannot be null . |
setId
fun setId(id: Int): Notification.ProgressStyle.Segment
Optional ID used to uniquely identify the element across updates.
Return | |
---|---|
Notification.ProgressStyle.Segment |
This value cannot be null . |