NotificationCompat.Metric


@RequiresApi(value = 26)
class NotificationCompat.Metric


A metric, used with MetricStyle, and which has a value and a label.

Summary

Nested types

A metric value for showing a date.

Metric corresponding to a floating point value.

Metric corresponding to an integer value.

Metric corresponding to a text value.

A metric value for showing a clock time.

A superclass for the various value types used by the Metric class.

This represents a timer, a stopwatch, or a countdown to an event.

Public constructors

Creates a Metric with the specified value and label.

Metric(
    value: NotificationCompat.Metric.MetricValue,
    label: CharSequence,
    semanticStyle: Int
)

Creates a Metric with the specified value, label, and semantic style.

Public functions

Boolean
equals(obj: Any!)
CharSequence

A label for the metric.

Int

Applies semantics to the metric.

NotificationCompat.Metric.MetricValue

A value for the metric.

Int
String

Public constructors

Metric

Metric(value: NotificationCompat.Metric.MetricValue, label: CharSequence)

Creates a Metric with the specified value and label.

Parameters
value: NotificationCompat.Metric.MetricValue

one of the subclasses of MetricValue, such as FixedInt

label: CharSequence

metric label -- should be 10 characters or fewer

Metric

Metric(
    value: NotificationCompat.Metric.MetricValue,
    label: CharSequence,
    semanticStyle: Int
)

Creates a Metric with the specified value, label, and semantic style.

Parameters
value: NotificationCompat.Metric.MetricValue

one of the subclasses of MetricValue, such as FixedInt

label: CharSequence

metric label -- should be 10 characters or fewer

semanticStyle: Int

semantic style applied to the metric. When the notification is promoted the metric value will be displayed (e.g. colored) according to this style.

Public functions

equals

fun equals(obj: Any!): Boolean

getLabel

fun getLabel(): CharSequence

A label for the metric.

The space allocated to this will depend on the number of metrics on the notification, but it's recommended to keep this to 10 characters or fewer.

getSemanticStyle

fun getSemanticStyle(): Int

Applies semantics to the metric. When the notification is promoted the metric value will be displayed (e.g. colored) according to this style.

getValue

fun getValue(): NotificationCompat.Metric.MetricValue

A value for the metric.

hashCode

fun hashCode(): Int

toString

fun toString(): String