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
marianomartin
b8f4b221f4
[Slider] Added min separation support
...
PiperOrigin-RevId: 322212299
2020-07-21 04:17:46 -07:00
marianomartin
cc031962d4
[Slider] Fixed exception when restoring instance state
...
Resolves https://github.com/material-components/material-components-android/issues/1284
PiperOrigin-RevId: 321392036
2020-07-15 13:57:02 -04:00
marianomartin
049ad022a6
Delete components build.gradle files
...
PiperOrigin-RevId: 320944144
2020-07-15 09:38:31 -07:00
marianomartin
34f621d22c
[Slider] Move static inner classes outside base slider class
...
Resolves https://github.com/material-components/material-components-android/issues/1342
Resolves https://github.com/material-components/material-components-android/issues/1471
PiperOrigin-RevId: 320607441
2020-07-10 11:48:43 -07:00
marianomartin
4eea03dff5
[RangeSlider] Fixed number of values changing in RangeSlider
...
https://github.com/material-components/material-components-android/issues/1460
https://github.com/material-components/material-components-android/issues/1393
PiperOrigin-RevId: 319980426
2020-07-07 11:01:15 -04:00
marianomartin
71fcb73c7f
[Slider] Changed slider thumbs to prevent crossing each other
...
PiperOrigin-RevId: 318502401
2020-06-26 14:13:27 -04:00
marianomartin
f945a0649b
[Slider] Rollback Slider Ally fixes, will address separately
...
PiperOrigin-RevId: 318169160
2020-06-26 14:08:53 -04:00
marianomartin
555356b03f
Internal cleanup
...
PiperOrigin-RevId: 318134343
2020-06-26 14:06:52 -04:00
marianomartin
fcbaa82f12
[Slider] Fixed focus changes after thumbs change original order
...
PiperOrigin-RevId: 317788551
2020-06-26 13:59:59 -04:00
marianomartin
aecb3be32f
[A11y] Added Range Start, Range End to slider content description
...
PiperOrigin-RevId: 317315616
2020-06-19 14:05:37 -04:00
marianomartin
34b2a17fcd
[A11y] Fixed focus changing on slider thumbs when they intercept
...
PiperOrigin-RevId: 317190322
2020-06-19 13:46:07 -04:00
Material Design Team
342ea9ad25
Internal cleanup
...
PiperOrigin-RevId: 317147378
2020-06-19 13:42:35 -04:00
Eugen Pechanec
a49e8867e9
[Slider] Keyboard navigation fix, part 2
...
Resolves https://github.com/material-components/material-components-android/pull/1395
GIT_ORIGIN_REV_ID=7762807c9e2b58c4156267c04ae9fbb080ed8835
PiperOrigin-RevId: 317126080
2020-06-18 13:25:31 -04:00
marianomartin
ba9c2e63ef
[Slider] Changed slider to support very small widths
...
Resolves https://github.com/material-components/material-components-android/issues/1243
PiperOrigin-RevId: 316741418
2020-06-17 18:35:12 -07:00
Eugen Pechanec
3e3bc41abb
[Slider] Keyboard navigation fix
...
Resolves https://github.com/material-components/material-components-android/pull/1364
GIT_ORIGIN_REV_ID=8a0fb870fafba516db529ffee13ea448964b0a9b
PiperOrigin-RevId: 315302829
2020-06-08 16:27:05 -04:00
Material Design Team
76ffe35fef
Cleanup
...
PiperOrigin-RevId: 313865830
2020-06-01 16:52:06 -04:00
connieshi
e521fda395
[Slider] Add range and invalid value to IllegalStateException message to make it more clear.
...
PiperOrigin-RevId: 312474145
2020-05-20 17:07:04 -04:00
marianomartin
8f0aa7f8d6
Split Slider into two classes
...
Slider throws an exception when calling getValue with more than one value. Supporting both single value and multiple values in the same class makes it confusing. While not supporting convenience methods getValue and setValue in the multi value class makes it, well, inconvenient.
In addition min, max are also a bit ambiguous since seekBar uses these for valueFrom and valueTo so those were removed.
PiperOrigin-RevId: 311774410
2020-05-18 11:19:05 -04:00
connieshi
7d92cd9a4a
Set Slider to be clickable by default.
...
Resolves https://github.com/material-components/material-components-android/issues/1121
PiperOrigin-RevId: 311732626
2020-05-18 11:16:55 -04:00
marianomartin
59c156013f
Make Slider a11y helper a static class
...
PiperOrigin-RevId: 310251893
2020-05-07 12:46:18 -04:00
connieshi
33683851f2
Remove "color" from getters/setters that end with "TintList" to be less verbose.
...
PiperOrigin-RevId: 307838995
2020-04-22 15:13:13 -04:00
connieshi
7a8f3bd48c
Rename color setters in Slider so it's obvious that color properties are ColorStateList.
...
PiperOrigin-RevId: 307436479
2020-04-20 15:04:20 -04:00
marianomartin
cc88816b82
[ProgressIndicator] initial commit
...
ORIGINAL_AUTHOR=pekingme
PiperOrigin-RevId: 306469609
2020-04-14 22:11:45 -04:00
hunterstich
d6501c97bc
[Slider] Fix attach/detach behavior when Slider is added in an overlay as part of a Transition.
...
Resolves https://github.com/material-components/material-components-android/issues/1195
A Visibility transition will add Slider to an overlay and then call onAttachToWindow/onDetachFromWindow which looks for an android.R.id.content view, which doen't exist, getting stuck in a loop. This adds an exit strategy for android.R.id.content not being found and fixes Slider in Visibility transitions.
PiperOrigin-RevId: 305886706
2020-04-13 10:21:36 -07:00
haodong
6d5d939134
[Javadoc] Fixed errors in Slider.java
...
PiperOrigin-RevId: 300572596
2020-03-13 11:09:36 -04:00
cketcham
5a34bad28b
Update content description for Slider
...
It shouldn't add the content description of the Slider if it doesn't exist.
It shouldn't add the min and max values if there's only 1 thumb.
PiperOrigin-RevId: 298453769
2020-03-05 12:58:24 -08:00
Paul Woitaschek
e2224fa0a4
Correctly initialize the slider state on instance state restoration.
...
Resolves https://github.com/material-components/material-components-android/pull/1072
GIT_ORIGIN_REV_ID=3a2adb451ab8b2879ea409793d0ebd6c60131f3d
PiperOrigin-RevId: 298379846
2020-03-02 15:37:08 -05:00
cketcham
84a351281e
Delay validation for Slider valueTo, valueFrom, stepSize, and values
...
This enables initially setting things that conflict. For instance if the current valueFrom is 0 and valueTo is 1, it's now possible to call setValueFrom() with something greater than 1 without immediately throwing an exception.
Resolves https://github.com/material-components/material-components-android/issues/923
PiperOrigin-RevId: 297671715
2020-02-28 09:35:36 -05:00
cketcham
1bc4f60d81
Handle single tap for Slider in scrollable container
...
PiperOrigin-RevId: 295160709
2020-02-14 17:13:07 -05:00
cketcham
767915868d
Fix Slider rounding error caused by floats
...
PiperOrigin-RevId: 294686381
2020-02-13 10:24:03 -05:00
cketcham
340cdea60d
Add a11y support to Slider
...
This includes support for Range slider when there is more than one thumb. Each thumb can receive focus and behaves as if it was it's own SeekBar.
Resolves https://github.com/material-components/material-components-android/issues/827
PiperOrigin-RevId: 294681995
2020-02-13 10:23:18 -05:00