83 Commits

Author SHA1 Message Date
pubiqq
9ce14ae3fd [Slider] Refactor track icon tinting
Resolves https://github.com/material-components/material-components-android/pull/4521

GIT_ORIGIN_REV_ID=674feb5f080ee2ea79245b17314d852893ece7d7
PiperOrigin-RevId: 712886599
2025-01-07 14:36:28 +00:00
pubiqq
ddda777dda [Slider] Always update track bounds before drawing icons
Resolves https://github.com/material-components/material-components-android/pull/4488

GIT_ORIGIN_REV_ID=0437dc5fd010715429822287ec12a8f77bffbe92
PiperOrigin-RevId: 712658525
2025-01-07 14:24:56 +00:00
pfthomas
63e1ec9a54 [Slider] a11y fixes
- demos are scrollable
- fix issue where increment is reversed when Slider is vertical

PiperOrigin-RevId: 703087896
2024-12-10 17:56:45 +00:00
pfthomas
35a82030f5 [Slider] a11y fixes
Resolves https://github.com/material-components/material-components-android/issues/2176

PiperOrigin-RevId: 702789538
2024-12-04 23:59:28 +00:00
pfthomas
05fa0ce58f [Slider] Update corner behavior
- add corner "squishy" effect as the thumb approaches the edges of the track.

PiperOrigin-RevId: 700775657
2024-12-02 20:06:28 +00:00
pfthomas
e1c83edbcb [Slider] Fix vertical slider broken with always visible labels
Resolves https://github.com/material-components/material-components-android/issues/4391

PiperOrigin-RevId: 700333450
2024-12-02 19:43:42 +00:00
pfthomas
60c09d98a1 [Slider] Add extra track icons support
- added support for start and end track icons
- removed the hide/show track icon logic to let the user implement it for more flexibility
- added demo
- updated tests + doc

PiperOrigin-RevId: 696960630
2024-11-21 17:25:26 +00:00
pfthomas
5bcda8a8d7 [Slider] Add vertical support
- added "orientation" attr allowing for vertical support
- updated tests and doc
- added demo

PiperOrigin-RevId: 695856298
2024-11-21 17:15:02 +00:00
pfthomas
2e95296eac [Slider] Add support for track icons
- added trackIconActive, trackIconActiveSize and trackIconActiveColor attrs
- added trackIconInactive, trackIconInactiveSize and trackIconInactiveColor attrs
- added tests and demos
- updated documentation

PiperOrigin-RevId: 689804000
2024-10-25 18:51:04 +00:00
pfthomas
7f4413dc4f [Slider] Make track corner size customizable
- add setTrackCornerSize/getTrackCornerSize to customize the track corners
- simplify track drawing logic for legacy Slider
- add demos

PiperOrigin-RevId: 688146199
2024-10-22 20:10:53 +00:00
manabu-nakamura
9bf5eddd8a [Slider] Make sure label is removed with slider is hidden
Resolves https://github.com/material-components/material-components-android/issues/4319
Resolves https://github.com/material-components/material-components-android/pull/4320

GIT_ORIGIN_REV_ID=6b96f2d40b77900b3479e3af61d3fa6f7c3e7c9d
PiperOrigin-RevId: 684473315
2024-10-14 16:33:10 +00:00
pekingme
237f5ec946 [Slider] Updated to show tooltips when focus by a11y.
PiperOrigin-RevId: 683257820
2024-10-09 16:36:10 +00:00
rightnao
1f56cd1783 [Slider] Fixes an exception caused by DecimalFormat not taking into account locale
PiperOrigin-RevId: 681165249
2024-10-07 14:17:23 +00:00
Material Design Team
59a753af24 Automated g4 rollback of changelist 676427467
PiperOrigin-RevId: 680642368
2024-10-01 19:04:24 +00:00
pfthomas
cebb0572a8 [Slider][a11y] Limit values to 2 decimals in the content description
PiperOrigin-RevId: 676427467
2024-09-20 19:45:27 +00:00
pubiqq
23aca03255 [Internal] Remove pre-Lollipop checks
Resolves https://github.com/material-components/material-components-android/pull/4266

GIT_ORIGIN_REV_ID=1de7808e66dd6666c893217c76c7499afe2df6a3
PiperOrigin-RevId: 669688797
2024-09-03 13:31:29 +00:00
manabu-nakamura
967dcd5e07 [Slider] Fix slider label not moving
Resolves https://github.com/material-components/material-components-android/pull/4104

GIT_ORIGIN_REV_ID=676308a77b429610192b1df80becb656e6053811
PiperOrigin-RevId: 666511279
2024-08-23 18:07:42 +00:00
pekingme
968a7ee02a [Slider] Updates tick marks color to fix the contrast in medium / high contrast modes.
Resolves https://github.com/material-components/material-components-android/issues/4204

PiperOrigin-RevId: 652895433
2024-07-22 18:24:33 +00:00
pubiqq
d85b73f952 [Slider] Fix the handle width when touched in a scrolling container and when more than one handle is in the touch position.
Resolves https://github.com/material-components/material-components-android/pull/4151
Resolves https://github.com/material-components/material-components-android/issues/4149
Resolves https://github.com/material-components/material-components-android/issues/4150

GIT_ORIGIN_REV_ID=d78e6e24416135fa1a21dc6e298902ab6b893490
PiperOrigin-RevId: 635894036
2024-05-23 14:51:32 +00:00
pubiqq
510881a469 [Internal] Stop using deprecated androidx.core.view.* methods
Resolves https://github.com/material-components/material-components-android/pull/4117

GIT_ORIGIN_REV_ID=dd157e8360c2511810496693cec1616fce578655
PiperOrigin-RevId: 632284856
2024-05-13 17:37:38 +00:00
pfthomas
f3a93d09a9 [NTC][Slider] Make tick size defaults to the stop indicator size if set
PiperOrigin-RevId: 617609939
2024-03-20 22:36:53 +00:00
pubiqq
bb646b68af [Slider] Fix incorrect style of stop indicators near handles
Resolves https://github.com/material-components/material-components-android/pull/4097

GIT_ORIGIN_REV_ID=927159e78777a16472d96b2740295bdbce6361ab
PiperOrigin-RevId: 615993493
2024-03-15 17:31:46 +00:00
pubiqq
3bc6612536 [Slider] Use a uniform way to update labels
Resolves https://github.com/material-components/material-components-android/pull/4093

GIT_ORIGIN_REV_ID=7db4936713bd31a070d4bb1d9743d99222840184
PiperOrigin-RevId: 614741678
2024-03-15 17:28:06 +00:00
Park-SM
ac77b4cfb5 [RangeSlider] Resolve issues that crash when assigning a large value to valueTo
Resolves https://github.com/material-components/material-components-android/pull/3979

GIT_ORIGIN_REV_ID=d09a42095cda8342b1f2a0fdf3a9ab9899cace45
PiperOrigin-RevId: 613196003
2024-03-06 11:47:24 -08:00
Thomas
399817ec77 [Slider] Updated the track drawing for some corner cases.
Resolves https://github.com/material-components/material-components-android/pull/4071
Resolves https://github.com/material-components/material-components-android/pull/4080
Resolves https://github.com/material-components/material-components-android/issues/4079
Resolves https://github.com/material-components/material-components-android/issues/4009

GIT_ORIGIN_REV_ID=76692c595d7e798545050ec22e6fafebe64f4587
PiperOrigin-RevId: 610841961
2024-02-29 08:54:52 -08:00
pfthomas
c218b3c983 [NTC][Slider] Update styles
Update the Material Slider to be compliant with the latest accessibility requirements.

PiperOrigin-RevId: 595740932
2024-01-04 19:25:12 +00:00
pfthomas
631065488c [NTC][Slider] Internal changes
PiperOrigin-RevId: 590310941
2023-12-13 16:29:33 +00:00
pfthomas
95e1c441c2 [NTC][Slider] Internal changes
PiperOrigin-RevId: 587826282
2023-12-05 16:14:39 +00:00
manabu-nakamura
144b5159ce [Slider] Fix slider label not moving while scrolling
Resolves https://github.com/material-components/material-components-android/pull/3848
Resolves https://github.com/material-components/material-components-android/issues/3847

GIT_ORIGIN_REV_ID=630698384082464cfb40d75156ec09abfc829bed
PiperOrigin-RevId: 584067588
2023-11-20 15:13:26 -05:00
rightnao
83a7ed8dd5 Automated g4 rollback of changelist 581318308
PiperOrigin-RevId: 582358366
2023-11-14 19:57:17 +00:00
pfthomas
5e5eee01bd [Slider] Fix slider label not moving while scrolling
Resolves https://github.com/material-components/material-components-android/issues/3660
Resolves https://github.com/material-components/material-components-android/issues/2869
Resolves https://github.com/material-components/material-components-android/pull/3665

PiperOrigin-RevId: 581318308
2023-11-13 15:09:45 +00:00
pfthomas
42466721ca [NTC][Slider] Internal changes
PiperOrigin-RevId: 581303119
2023-11-13 14:56:39 +00:00
Material Design Team
93f8ffb46a [Slider] Add mouse support for slider control.
This change makes it so that mouse input does not behave exactly like touch when using a slider. Previously, any time a touch event was detected on a slider bar, we would postpone updating the slider position because there was potential for a pan drag if the container was a scrollable view. See cl/286431744. However for mouse input this should never apply because a mouse down event should not be able to scroll the container.

This change also fixes the halo not updating when clicking or touching down on the slider (without dragging). This isn't very noticeable when only using touch input but when hovering over the control with a mouse, you can see the halo was in the last position of the slider instead of the current position.

PiperOrigin-RevId: 495905645
2022-12-19 22:59:24 +00:00
rightnao
dfb9e81eeb [Motion] Motion tweaks
PiperOrigin-RevId: 493105642
2022-12-06 15:22:34 -05:00
minwang1
7bbbe3925e [Slider] Added API for setting the radius of active/inactive tick in xml and Java.
Resolves https://github.com/material-components/material-components-android/pull/2994
Resolves https://github.com/material-components/material-components-android/issues/1920

GIT_ORIGIN_REV_ID=7bf15fb545496cb8e63f8b6ecf653229b1f203f8
PiperOrigin-RevId: 492557754
2022-12-02 18:36:26 -05:00
Jerry Zhu
9e210ea731 [Slider] Add current value to talkback for Slider
Resolves https://github.com/material-components/material-components-android/pull/2964

GIT_ORIGIN_REV_ID=02fe1a0b529369772fec9c52631c75c1865535f3
PiperOrigin-RevId: 479097052
2022-10-06 17:51:41 +00:00
pubiqq
bcb551b8a0 [Slider] Fix compat halo visibility
Resolves https://github.com/material-components/material-components-android/pull/2951

GIT_ORIGIN_REV_ID=f3cd8ddc7a7b1fee6fac9378515ce3668fcc6b70
PiperOrigin-RevId: 472846843
2022-09-08 14:23:16 -04:00
pubiqq
a137c28b77 [Slider] Do not capture inflation parameters for reuse
Resolves https://github.com/material-components/material-components-android/pull/2931

GIT_ORIGIN_REV_ID=6fd66149c9f67df309f29770e39d7a95eac2deea
PiperOrigin-RevId: 471813225
2022-09-02 13:01:02 -07:00
rightnao
c7a3d5e874 [Slider] Update motion attributes
PiperOrigin-RevId: 469285824
2022-08-24 14:37:08 -07:00
pubiqq
f3a5f2ff8a [Slider] Release slider thumb if gesture has been cancelled
Reoslves https://github.com/material-components/material-components-android/issues/2883
Resolves https://github.com/material-components/material-components-android/pull/2884

GIT_ORIGIN_REV_ID=e0a3ace3377b6e7ed4bc4e69470179ace3ab1d7f
PiperOrigin-RevId: 465631921
2022-08-08 11:00:18 -04:00
pekingme
f3952f83df [Slider] Ensured the minimum touch size of handle is 48dp
PiperOrigin-RevId: 465125601
2022-08-04 14:47:42 -04:00
conradchen
4122837619 [Slider] Fix NPE when trying to remove labels when ViewOverlay doesn't exist yet
Resolves https://github.com/material-components/material-components-android/issues/2845

PiperOrigin-RevId: 462418275
2022-07-22 15:22:59 +00:00
Sujit Kumar
ed11e694e7 [Slider] Fix label visibility when slider is hidden
Resolves https://github.com/material-components/material-components-android/pull/2730
Resolves https://github.com/material-components/material-components-android/issues/2726

GIT_ORIGIN_REV_ID=40d8798531f9a4ec82465909c8ec9b83d0201371
PiperOrigin-RevId: 452791189
2022-06-03 12:09:21 -07:00
pubiqq
3ca41be8f0 [General] Fix typos
Resolves https://github.com/material-components/material-components-android/pull/2654

GIT_ORIGIN_REV_ID=b8f6728979875629f2c813ef90d2f671cf56b4eb
PiperOrigin-RevId: 442852630
2022-04-19 14:48:55 -04:00
conradchen
dc0d8a956e [Slider] Make slider's height adjustable with track height or thumb radius
Resolves https://github.com/material-components/material-components-android/issues/1923

PiperOrigin-RevId: 440913851
2022-04-11 12:42:09 -04:00
pekingme
ca8594d2d2 [Slider] Added LABEL_VISIBLE to label behavior and added a demo fragment in catalog.
Resolves https://github.com/material-components/material-components-android/issues/1316

PiperOrigin-RevId: 433570701
2022-03-09 22:14:31 +00:00
conradchen
78b532c420 [Slider] Refine javadocs of thumb radius setters
PiperOrigin-RevId: 432265042
2022-03-04 13:05:29 -05:00
conradchen
17da000a29 [Slider] Add support for custom thumb drawables
Resolves https://github.com/material-components/material-components-android/issues/1522

PiperOrigin-RevId: 429607888
2022-02-23 11:10:12 -08:00
Material Design Team
cfc00aa5a3 Update android core class definitions across material
PiperOrigin-RevId: 414839941
2021-12-08 14:56:25 +00:00
Material Design Team
a487c89185 Internal change
PiperOrigin-RevId: 412135443
2021-11-29 17:35:39 +00:00