NotificationCompat.Metric.FixedFloat


class NotificationCompat.Metric.FixedFloat : NotificationCompat.Metric.MetricValue


Metric corresponding to a floating point value.

Summary

Public constructors

FixedFloat(value: Float)

Creates a FixedFloat instance with no unit and 0 minimum and 3 maximum fractional digits.

FixedFloat(value: Float, unit: CharSequence?)

Creates a FixedFloat instance with 0 minimum and 2 maximum fractional digits.

FixedFloat(
    value: Float,
    unit: CharSequence?,
    minFractionDigits: @IntRange(from = 0, to = 6) Int,
    maxFractionDigits: @IntRange(from = 0, to = 6) Int
)

Creates a FixedFloat instance.

Public functions

Boolean
equals(obj: Any!)
@IntRange(from = 0, to = 6) Int

Maximum number of fractional digits to display.

@IntRange(from = 0, to = 6) Int

Minimum number of fractional digits to display.

CharSequence?

The unit of measurement for the value, if required.

Float

The fractional value.

Int
String

Public constructors

FixedFloat

FixedFloat(value: Float)

Creates a FixedFloat instance with no unit and 0 minimum and 3 maximum fractional digits.

FixedFloat

FixedFloat(value: Float, unit: CharSequence?)

Creates a FixedFloat instance with 0 minimum and 2 maximum fractional digits.

Parameters
value: Float

numeric value

unit: CharSequence?

optional unit for the value. Limit this to a few characters.

FixedFloat

FixedFloat(
    value: Float,
    unit: CharSequence?,
    minFractionDigits: @IntRange(from = 0, to = 6) Int,
    maxFractionDigits: @IntRange(from = 0, to = 6) Int
)

Creates a FixedFloat instance.

Parameters
value: Float

numeric value

unit: CharSequence?

optional unit for the value. Limit this to a few characters.

minFractionDigits: @IntRange(from = 0, to = 6) Int

minimum number of factional digits to display (0-6)

maxFractionDigits: @IntRange(from = 0, to = 6) Int

maximum number of factional digits to display (0-6 and >= minFractionDigits)

Throws
java.lang.IllegalArgumentException

if minFractionDigits or maxFractionDigits do not respect the specified constraints

Public functions

equals

fun equals(obj: Any!): Boolean

getMaxFractionDigits

fun getMaxFractionDigits(): @IntRange(from = 0, to = 6) Int

Maximum number of fractional digits to display.

getMinFractionDigits

fun getMinFractionDigits(): @IntRange(from = 0, to = 6) Int

Minimum number of fractional digits to display.

getUnit

fun getUnit(): CharSequence?

The unit of measurement for the value, if required.

This may not be shown to the user in all views.

The space allocated to this will be limited. It's recommended to limit this to just a few characters.

getValue

fun getValue(): Float

The fractional value.

hashCode

fun hashCode(): Int

toString

fun toString(): String