Skip to content

Commit 4246672

Browse files
paulfthomasdsn5ft
authored andcommitted
[NTC][Slider] Internal changes
PiperOrigin-RevId: 581303119
1 parent 1bbb43d commit 4246672

File tree

6 files changed

+457
-83
lines changed

6 files changed

+457
-83
lines changed

docs/components/Slider.md

Lines changed: 28 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -289,34 +289,41 @@ slider also has tick marks.
289289

290290
#### Track attributes
291291

292-
Element | Attribute | Related method(s) | Default value
293-
------------------------------------------ | ------------------------ | --------------------------------------------------------- | -------------
294-
**Min value** | `android:valueFrom` | `setValueFrom`<br/>`getValueFrom` | N/A
295-
**Max value** | `android:valueTo` | `setValueTo`<br/>`getValueTo` | N/A
296-
**Step size (discrete)** | `android:stepSize` | `setStepSize`<br/>`getStepSize` | N/A
297-
**Initial selected value (Slider)** | `android:value` | `setValue`<br/>`getValue` | N/A
298-
**Initial selected values (RangeSlider)** | `app:values` | `setValues`<br/>`getValues` | N/A
299-
**Height** | `app:trackHeight` | `setTrackHeight`<br/>`getTrackHeight` | `4dp`
300-
**Color** | `app:trackColor` | `setTrackTintList`<br/>`getTrackTintList` | `null`
301-
**Color for track's active part** | `app:trackColorActive` | `setTrackActiveTintList`<br/>`getTrackActiveTintList` | `?attr/colorPrimary`
302-
**Color for track's inactive part** | `app:trackColorInactive` | `setTrackInactiveTintList`<br/>`getTrackInactiveTintList` | `?attr/colorSurfaceContainerHighest`
303-
**Minimum separation for adjacent thumbs** | `app:minSeparation` | `setMinSeparation`<br/>`getMinSeparation` | `0dp`
292+
| Element | Attribute | Related method(s) | Default value |
293+
|--------------------------------------------|------------------------------|-------------------------------------------------------------|--------------------------------------|
294+
| **Min value** | `android:valueFrom` | `setValueFrom`<br/>`getValueFrom` | N/A |
295+
| **Max value** | `android:valueTo` | `setValueTo`<br/>`getValueTo` | N/A |
296+
| **Step size (discrete)** | `android:stepSize` | `setStepSize`<br/>`getStepSize` | N/A |
297+
| **Initial selected value (Slider)** | `android:value` | `setValue`<br/>`getValue` | N/A |
298+
| **Initial selected values (RangeSlider)** | `app:values` | `setValues`<br/>`getValues` | N/A |
299+
| **Height** | `app:trackHeight` | `setTrackHeight`<br/>`getTrackHeight` | `4dp` |
300+
| **Color** | `app:trackColor` | `setTrackTintList`<br/>`getTrackTintList` | `null` |
301+
| **Color for track's active part** | `app:trackColorActive` | `setTrackActiveTintList`<br/>`getTrackActiveTintList` | `?attr/colorPrimary` |
302+
| **Color for track's inactive part** | `app:trackColorInactive` | `setTrackInactiveTintList`<br/>`getTrackInactiveTintList` | `?attr/colorSurfaceContainerHighest` |
303+
| **Inside corner size** | `app:trackInsideCornerSize` | `setTrackInsideCornerSize`<br/>`getTrackInsideCornerSize` | `2dp` |
304+
| **Stop indicator size** | `app:trackStopIndicatorSize` | `setTrackStopIndicatorSize`<br/>`getTrackStopIndicatorSize` | `4dp` |
305+
| **Minimum separation for adjacent thumbs** | `app:minSeparation` | `setMinSeparation`<br/>`getMinSeparation` | `0dp` |
304306

305307
**Note:** `app:trackColor` takes precedence over `app:trackColorActive` and
306308
`app:trackColorInative`. It's a shorthand for setting both values to the same
307309
thing.
308310

309311
#### Thumb attributes
310312

311-
Element | Attribute | Related method(s) | Default value
312-
---------------- | ---------------------- | --------------------------------------------------------------------------------- | -------------
313-
**Color** | `app:thumbColor` | `setThumbTintList`<br/>`getThumbTintList` | `?attr/colorPrimary`
314-
**Radius** | `app:thumbRadius` | `setThumbRadiusResource`<br/>`setThumbRadius`<br/>`getThumbRadius` | `10dp`
315-
**Elevation** | `app:thumbElevation` | `setThumbElevationResource`<br/>`setThumbElevation`<br/>`getThumbElevation` | `2dp`
316-
**Halo color** | `app:haloColor` | `setHaloTintList`<br/>`getHaloTintList` | `?attr/colorPrimary` at 24%
317-
**Halo radius** | `app:haloRadius` | `setHaloRadiusResource`<br/>`setHaloRadius`<br/>`getHaloRadius` | `24dp`
318-
**Stroke color** | `app:thumbStrokeColor` | `setThumbStrokeColor`<br/>`setThumbStrokeColorResource`<br/>`getThumbStrokeColor` | `null`
319-
**Stroke width** | `app:thumbStrokeWidth` | `setThumbStrokeWidth`<br/>`setThumbStrokeWidthResource`<br/>`getThumbStrokeWidth` | `0dp`
313+
| Element | Attribute | Related method(s) | Default value |
314+
|------------------|-------------------------|-----------------------------------------------------------------------------------|-----------------------------|
315+
| **Color** | `app:thumbColor` | `setThumbTintList`<br/>`getThumbTintList` | `?attr/colorPrimary` |
316+
| **Width** | `app:thumbWidth` | `setThumbWidth`<br/>`setThumbWidthResource`<br/>`getThumbWidth` | `4dp` |
317+
| **Height** | `app:thumbHeight` | `setThumbHeight`<br/>`setThumbHeightResource`<br/>`getThumbHeight` | `44dp` |
318+
| **Radius** | `app:thumbRadius` | `setThumbRadiusResource`<br/>`setThumbRadius`<br/>`getThumbRadius` | `10dp` |
319+
| **Elevation** | `app:thumbElevation` | `setThumbElevationResource`<br/>`setThumbElevation`<br/>`getThumbElevation` | `2dp` |
320+
| **Halo color** | `app:haloColor` | `setHaloTintList`<br/>`getHaloTintList` | `?attr/colorPrimary` at 24% |
321+
| **Halo radius** | `app:haloRadius` | `setHaloRadiusResource`<br/>`setHaloRadius`<br/>`getHaloRadius` | `24dp` |
322+
| **Stroke color** | `app:thumbStrokeColor` | `setThumbStrokeColor`<br/>`setThumbStrokeColorResource`<br/>`getThumbStrokeColor` | `null` |
323+
| **Stroke width** | `app:thumbStrokeWidth` | `setThumbStrokeWidth`<br/>`setThumbStrokeWidthResource`<br/>`getThumbStrokeWidth` | `0dp` |
324+
| **Gap size** | `app:thumbTrackGapSize` | `setThumbTrackGapSize`<br/>`getThumbTrackGapSize` | `6dp` |
325+
326+
**Note:** `app:thumbWidth` and `app:thumbHeight` take precedence over `app:thumbRadius`.
320327

321328
#### Value label attributes
322329

0 commit comments

Comments
 (0)