FixedFloat


class FixedFloat : Notification.Metric.MetricValue
kotlin.Any
   ↳ android.app.Notification.Metric.MetricValue
   ↳ android.app.Notification.Metric.FixedFloat

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: Int, maxFractionDigits: Int)

Creates a FixedFloat instance.

Public methods
Boolean
equals(other: Any?)

Int

Maximum number of fractional digits to display.

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
unit CharSequence?: optional unit for the value. Limit this to a few characters.
This value may be null.

FixedFloat

FixedFloat(
    value: Float,
    unit: CharSequence?,
    minFractionDigits: Int,
    maxFractionDigits: Int)

Creates a FixedFloat instance.

Parameters
unit CharSequence?: optional unit for the value. Limit this to a few characters.
This value may be null.
minFractionDigits Int: minimum number of factional digits to display (0-6).
Value is between #LOWER_BOUND_FRACTION_DIGITS and #UPPER_BOUND_FRACTION_DIGITS inclusive
maxFractionDigits Int: maximum number of factional digits to display (0-6 and >= minFractionDigits).
Value is between #LOWER_BOUND_FRACTION_DIGITS and #UPPER_BOUND_FRACTION_DIGITS inclusive
Exceptions
java.lang.IllegalArgumentException if minFractionDigits or maxFractionDigits do not respect the specified constraints

Public methods

equals

fun equals(other: Any?): Boolean

getMaxFractionDigits

fun getMaxFractionDigits(): Int

Maximum number of fractional digits to display.

Return
Int Value is between #LOWER_BOUND_FRACTION_DIGITS and #UPPER_BOUND_FRACTION_DIGITS inclusive

getMinFractionDigits

fun getMinFractionDigits(): Int

Minimum number of fractional digits to display.

Return
Int Value is between #LOWER_BOUND_FRACTION_DIGITS and #UPPER_BOUND_FRACTION_DIGITS inclusive

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.

Return
CharSequence? This value may be null.

getValue

fun getValue(): Float

The fractional value.

hashCode

fun hashCode(): Int

toString

fun toString(): String