NotificationCompat.Metric.FixedDate


public final class NotificationCompat.Metric.FixedDate extends NotificationCompat.Metric.MetricValue


A metric value for showing a date.

Summary

Constants

static final int

Formatting option.

static final int

Formatting option.

static final int

Formatting option.

Public constructors

Creates a FixedDate where the LocalDate will be displayed with FORMAT_AUTOMATIC.

FixedDate(@NonNull LocalDate value, int format)

Creates a FixedDate where the LocalDate will be displayed in the specified formatting option.

Public methods

boolean
int

The formatting option for the LocalDate value.

@NonNull LocalDate

The LocalDate value.

int
@NonNull String

Constants

FORMAT_AUTOMATIC

public static final int FORMAT_AUTOMATIC = 0

Formatting option. The system will decide how to format the date, and whether to omit any pieces, depending on available space, the relationship between the LocalDate and the current date, etc.

FORMAT_LONG_DATE

public static final int FORMAT_LONG_DATE = 1

Formatting option. The date will be shown in a longer format, e.g. "Aug 13 2025" (according to the device's locale).

FORMAT_SHORT_DATE

public static final int FORMAT_SHORT_DATE = 2

Formatting option. The date will be shown in a shorter format, e.g. "13/8/25" (according to the device's locale).

Public constructors

FixedDate

public FixedDate(@NonNull LocalDate value)

Creates a FixedDate where the LocalDate will be displayed with FORMAT_AUTOMATIC.

FixedDate

public FixedDate(@NonNull LocalDate value, int format)

Creates a FixedDate where the LocalDate will be displayed in the specified formatting option.

Public methods

equals

public boolean equals(Object obj)

getFormat

public int getFormat()

The formatting option for the LocalDate value.

getValue

public @NonNull LocalDate getValue()

The LocalDate value.

hashCode

public int hashCode()

toString

public @NonNull String toString()