NotificationCompat.Metric.FixedFloat
public final class NotificationCompat.Metric.FixedFloat extends NotificationCompat.Metric.MetricValue
| java.lang.Object | ||
| ↳ | androidx.core.app.NotificationCompat.Metric.MetricValue | |
| ↳ | androidx.core.app.NotificationCompat.Metric.FixedFloat |
Metric corresponding to a floating point value.
Summary
Public constructors |
|---|
FixedFloat(float value)Creates a |
FixedFloat(float value, @Nullable CharSequence unit)Creates a |
FixedFloat(Creates a |
Public methods |
|
|---|---|
boolean |
|
@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. |
@Nullable CharSequence |
getUnit()The unit of measurement for the value, if required. |
float |
getValue()The fractional value. |
int |
hashCode() |
@NonNull String |
toString() |
Public constructors
FixedFloat
public FixedFloat(float value)
Creates a FixedFloat instance with no unit and 0 minimum and 3 maximum fractional digits.
FixedFloat
public FixedFloat(float value, @Nullable CharSequence unit)
Creates a FixedFloat instance with 0 minimum and 2 maximum fractional digits.
| Parameters | |
|---|---|
float value |
numeric value |
@Nullable CharSequence unit |
optional unit for the value. Limit this to a few characters. |
FixedFloat
public FixedFloat(
float value,
@Nullable CharSequence unit,
@IntRange(from = 0, to = 6) int minFractionDigits,
@IntRange(from = 0, to = 6) int maxFractionDigits
)
Creates a FixedFloat instance.
| Parameters | |
|---|---|
float value |
numeric value |
@Nullable CharSequence unit |
optional unit for the value. Limit this to a few characters. |
@IntRange(from = 0, to = 6) int minFractionDigits |
minimum number of factional digits to display (0-6) |
@IntRange(from = 0, to = 6) int maxFractionDigits |
maximum number of factional digits to display (0-6 and >= |
| Throws | |
|---|---|
java.lang.IllegalArgumentException |
if |
Public methods
getMaxFractionDigits
public @IntRange(from = 0, to = 6) int getMaxFractionDigits()
Maximum number of fractional digits to display.
getMinFractionDigits
public @IntRange(from = 0, to = 6) int getMinFractionDigits()
Minimum number of fractional digits to display.
getUnit
public @Nullable CharSequence getUnit()
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.