Stay organized with collections
Save and categorize content based on your preferences.
public
interface
LabelFormatter
com.google.android.material.slider.LabelFormatter
|
Known indirect subclasses
BasicLabelFormatter |
A simple implementation of the LabelFormatter interface, that limits the number
displayed inside a discrete slider's bubble to three digits, and a single-character suffix that
denotes magnitude (e.g.: 1.5K, 2.2M, 1.3B, 2T).
|
|
Interface definition for applying custom formatting to the text displayed inside the bubble
shown when a slider is used in discrete mode.
Summary
Constants
LABEL_FLOATING
public static final int LABEL_FLOATING
Constant Value:
0
(0x00000000)
LABEL_GONE
public static final int LABEL_GONE
Constant Value:
2
(0x00000002)
LABEL_VISIBLE
public static final int LABEL_VISIBLE
Constant Value:
3
(0x00000003)
LABEL_WITHIN_BOUNDS
public static final int LABEL_WITHIN_BOUNDS
Constant Value:
1
(0x00000001)
Public methods
public abstract String getFormattedValue (float value)
Content and code samples on this page are subject to the licenses described in the Content License. Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.
Last updated 2025-02-10 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-02-10 UTC."],[],[],null,["# LabelFormatter\n\nSummary: [Constants](#constants) \\| [Methods](#pubmethods) \n\nLabelFormatter\n==============\n\n\n`\npublic\n\n\ninterface\nLabelFormatter\n`\n\n\n`\n\n\n`\n\n|---------------------------------------------------|\n| com.google.android.material.slider.LabelFormatter |\n\n|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| Known indirect subclasses [BasicLabelFormatter](/reference/com/google/android/material/slider/BasicLabelFormatter) |------------------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | [BasicLabelFormatter](/reference/com/google/android/material/slider/BasicLabelFormatter) | A simple implementation of the [LabelFormatter](/reference/com/google/android/material/slider/LabelFormatter) interface, that limits the number displayed inside a discrete slider's bubble to three digits, and a single-character suffix that denotes magnitude (e.g.: 1.5K, 2.2M, 1.3B, 2T). | |\n\n\u003cbr /\u003e\n\n*** ** * ** ***\n\nInterface definition for applying custom formatting to the text displayed inside the bubble\nshown when a slider is used in discrete mode.\n\nSummary\n-------\n\n| ### Constants ||\n|-------|---------------------------------------------------------------------------------------------------------|\n| `int` | [LABEL_FLOATING](/reference/com/google/android/material/slider/LabelFormatter#LABEL_FLOATING) |\n| `int` | [LABEL_GONE](/reference/com/google/android/material/slider/LabelFormatter#LABEL_GONE) |\n| `int` | [LABEL_VISIBLE](/reference/com/google/android/material/slider/LabelFormatter#LABEL_VISIBLE) |\n| `int` | [LABEL_WITHIN_BOUNDS](/reference/com/google/android/material/slider/LabelFormatter#LABEL_WITHIN_BOUNDS) |\n\n| ### Public methods ||\n|--------------------|-------------------------------------------------------------------------------------------------------------------------------|\n| ` abstract String` | ` `[getFormattedValue](/reference/com/google/android/material/slider/LabelFormatter#getFormattedValue(float))`(float value) ` |\n\nConstants\n---------\n\n### LABEL_FLOATING\n\n```\npublic static final int LABEL_FLOATING\n```\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\nConstant Value:\n\n0\n(0x00000000)\n\n\n### LABEL_GONE\n\n```\npublic static final int LABEL_GONE\n```\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\nConstant Value:\n\n2\n(0x00000002)\n\n\n### LABEL_VISIBLE\n\n```\npublic static final int LABEL_VISIBLE\n```\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\nConstant Value:\n\n3\n(0x00000003)\n\n\n### LABEL_WITHIN_BOUNDS\n\n```\npublic static final int LABEL_WITHIN_BOUNDS\n```\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\nConstant Value:\n\n1\n(0x00000001)\n\n\nPublic methods\n--------------\n\n### getFormattedValue\n\n```\npublic abstract String getFormattedValue (float value)\n```\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n| Parameters ||\n|---------|----------------|\n| `value` | `float` \u003cbr /\u003e |\n\n| Returns ||\n|----------|--------|\n| `String` | \u003cbr /\u003e |"]]