129 Commits

Author SHA1 Message Date
pekingme
8204856dd4 [Token][Color] Upgraded to v0.170 for tonal surface colors.
PiperOrigin-RevId: 555230534
2023-08-09 19:03:25 +00:00
rightnao
e3b255b3a0 [Docs] Crosslink github docs in javadocs
PiperOrigin-RevId: 546393704
2023-07-11 19:37:37 +00:00
pekingme
9f1caa2c64 [Tokens] Upgraded to v0.162.
PiperOrigin-RevId: 517446114
2023-03-20 21:23:07 +00:00
pekingme
23dc14ca3a [Tokens] Updated to v0.157.
PiperOrigin-RevId: 505978081
2023-01-31 20:01:13 +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
pekingme
2019bf90be [Tokens] Upgraded to version v0.147.
PiperOrigin-RevId: 492551875
2022-12-02 18:34:12 -05:00
pekingme
17e3581642 [Tokens] Upgraded to v0.145
PiperOrigin-RevId: 492291163
2022-12-02 15:11:37 +00:00
pekingme
b9963a5212 [Tokens][Android] Omitted more comments when configuration specifies no comments.
PiperOrigin-RevId: 492290497
2022-12-02 15:04:22 +00:00
pekingme
8ee6c00f73 [Tokens] Upgraded to v0.142
Added lStar CSLs for new neutral palettes in v31 and above.

PiperOrigin-RevId: 491693724
2022-11-30 17:31:11 -05:00
pekingme
12ef329276 [Tokens] Upgraded to v0.141
PiperOrigin-RevId: 490324728
2022-11-23 15:13:20 -05:00
pekingme
b2b546b205 [Tokens] Internal updates.
PiperOrigin-RevId: 490295053
2022-11-23 15:11:19 -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
pekingme
ed77ab36cc [Tokens] Refreshed outdated component token resources files.
PiperOrigin-RevId: 477262742
2022-09-28 00:07:41 +00:00
conradchen
4a1e6bc42a [Slider] Integrate component tokens
PiperOrigin-RevId: 475405055
2022-09-22 17:34:52 +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
conradchen
3cf0647da0 [Slider] Fix lint error caused by hidden super interface
Overriding the inherited methods from a hidden super interface to fix lint errors caused by those methods being hidden.

Resolves https://github.com/material-components/material-components-android/issues/2493

PiperOrigin-RevId: 421909180
2022-01-18 12:03:14 -05: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
Daniel Frett
8297cf86ab [Slider] addOnChangeListener should take NonNull value
Resolves https://github.com/material-components/material-components-android/pull/2377

GIT_ORIGIN_REV_ID=e839483bfa9331ecc728ebf283d0c48d40af8fa9
PiperOrigin-RevId: 400212014
2021-10-01 15:57:46 +00:00
serniebanders
ac66cd8cfb [M3][Docs] Update slider documentation to describe M3 themes/styles.
Additionally exposes M3 slider styles in res-public

PiperOrigin-RevId: 395957248
2021-09-15 12:56:46 -07:00
conradchen
0064aa1e9c [M3][Slider] Create M3 styles
PiperOrigin-RevId: 392503743
2021-08-24 15:43:21 -04:00
Material Design Team
2d589bd351 [RangeSlider] Fix minSeparation having no effect when stepSize > 0
Resolves https://github.com/material-components/material-components-android/issues/2147

Note: `minSeparation` cannot be set as a dimension when using `stepSize`, make sure to use `rangeSlider.setMinSeparationValue()`.
PiperOrigin-RevId: 383893367
2021-07-12 19:39:32 +00:00
conradchen
db8b239021 [Slider] Do not invoke OnChangeListeners when restoring states
Calling setValueInternal() will invoke OnChangeListeners if the values have been changed. We shouldn't unconditionally invoke listeners again, otherwise:

- If values haven't changed, OnChangeListeners will still be fired.
- If values have changed, OnChangeListeners will be fired twice.

Removes the unconditional invocation to solve the issue.

PiperOrigin-RevId: 382785198
2021-07-07 19:20:57 +00:00
conradchen
8431bd43eb [RangeSlider] Fix halo showing under wrong thumbs
Halo's showing position depends on the focused thumb index, which
would not be updated if there's no need to snap the thumb position.
This causes halo shows under the previously focused thumb if you
click on the exact position of the new thumb.

Always updates the focused thumb when doing snapping to solve the
issue.

Resolves https://www.google.com/url?q=https://github.com/material-components/material-components-android/issues/2150

PiperOrigin-RevId: 381533677
2021-06-28 13:06:21 -07:00
Carsten Hagemann
1f76fcc70f [Slider] Improve listener documentation, fix #1900
Resolves https://github.com/material-components/material-components-android/issues/1900
Resolves https://github.com/material-components/material-components-android/pull/1901

GIT_ORIGIN_REV_ID=70b2b0a1f2bc5798165913cb7dd2e015ff55abdf
PiperOrigin-RevId: 345003325
2020-12-01 09:30:36 -05:00
Maxim Sutkovenko
b2b87dd434 [Slider] Fixed slider doesn't slide in Horizontal Recycler View
Resolves https://github.com/material-components/material-components-android/pull/1847
Resolves https://github.com/material-components/material-components-android/issues/1843

GIT_ORIGIN_REV_ID=21cfc4d93954cdcb6ffbac00f085a3ca3b6ed2de
PiperOrigin-RevId: 340658479
2020-11-04 14:28:22 -05:00
cketcham
64843c9786 [Slider] Fix touch tracking callbacks
In some cases start tracking touch wouldn't be called, and in others stop tracking touch would be called even if no pointer was ever updated

PiperOrigin-RevId: 337314602
2020-10-15 13:41:20 -07:00
cketcham
aad88a0b38 [Slider] Stop checking for scroll if not in a scrolling container
This allows the thumb to be repositioned more quickly if the thumb is moved a little rather than waiting for the touch to move past the slop.

PiperOrigin-RevId: 336929171
2020-10-15 13:19:50 -07:00
hunterstich
1fc5e8c51c [Slider] Added animation to scale in/out label above thumbs.
PiperOrigin-RevId: 336635571
2020-10-15 13:13:28 -07:00
Brandon Lerner
416b8cb94a [Slider] Invalidate after new ColorStateList and return early if same
Resolves https://github.com/material-components/material-components-android/pull/1786

GIT_ORIGIN_REV_ID=1459f706028f25b13d8dbae850ea66b4b8294153
PiperOrigin-RevId: 336111124
2020-10-15 12:23:54 -07:00
Gabriele Mariotti
7c6dc5f70b [Slider] Fixed trackSidePadding when thumbRadius >= 16dp
Resolves https://github.com/material-components/material-components-android/pull/1584

GIT_ORIGIN_REV_ID=f75d389074e7b45fc346f3629d4deaa07222b483
Co-authored-by: pekingme <pekingme@gmail.com>
PiperOrigin-RevId: 333581466
2020-09-25 09:17:03 -07:00
Gabriele Mariotti
487e321497 [Slider] Added options to set thumbStrokeColor and thumbStrokeWidth
Resolves https://github.com/material-components/material-components-android/pull/1653
Resolves https://github.com/material-components/material-components-android/issues/1652

GIT_ORIGIN_REV_ID=ba5cab25a210a34e9d6396101ad045c8cfc8cb92
PiperOrigin-RevId: 328542122
2020-08-26 17:40:22 -04:00
cketcham
7e37eaa252 [Slider] Adds a warning message if the stepSize or any values are set to float values with a decimal to suggest using integers.
PiperOrigin-RevId: 327685433
2020-08-20 16:49:45 -04:00
cketcham
5004d5a521 [Slider] Fix the validation of the slider step size and values.
Resolves https://github.com/material-components/material-components-android/issues/1587

PiperOrigin-RevId: 327419448
2020-08-19 17:40:53 -04:00
dniz
b0240d9a77 [Resources] Fixed the types of some public attrs
Resolves https://github.com/material-components/material-components-android/issues/1560

PiperOrigin-RevId: 325010287
2020-08-05 10:59:36 -04:00
Gabriele Mariotti
5fb7964372 [Slider] Added option to show/hide tick marks in discrete mode
Resolves https://github.com/material-components/material-components-android/pull/1545

GIT_ORIGIN_REV_ID=6c5dc94df08ad7ec202722d5b546795f436de404
PiperOrigin-RevId: 324263710
2020-07-31 15:44:30 -04:00
Mattia
57a31caef5 [Slider] Added XML enabled property to constructor attrs evaluation
Resolves https://github.com/material-components/material-components-android/issues/1531
Resolves https://github.com/material-components/material-components-android/pull/1534

GIT_ORIGIN_REV_ID=79a45af769f604f3fb1c4f0f82fb05f36f0934aa
PiperOrigin-RevId: 323783892
2020-07-29 10:41:35 -04:00