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
cketcham
9de1c97979
Add RTL support for Slider
...
PiperOrigin-RevId: 294114681
2020-02-10 10:01:30 -05:00
cketcham
5076e0ac30
Prevent Slider from intercepting the the back key
...
This prevents Slider from intercepting the back key when you'd expect the activity to handle it.
PiperOrigin-RevId: 293605504
2020-02-06 17:24:58 -05:00
cketcham
4c99e53db4
Add support for D pad and keyboard control for Slider
...
This adds support for selecting an active thumb as well as changing the value of the currently selected thumb.
https://github.com/material-components/material-components-android/issues/827
PiperOrigin-RevId: 293008598
2020-02-04 17:30:25 -05:00
cketcham
e4e10e2238
Render the focused Slider value indicator on top
...
This also adds a surface color outline to the tooltip when there is more than one thumb so they can be distinguished when on top of each other.
PiperOrigin-RevId: 292558316
2020-01-31 13:38:05 -05:00
cketcham
99932525e9
Improve handling of touch input for Slider with multiple thumbs
...
This changes the logic of picking the correct thumb on touch down. The closest thumb will be picked unless there are two thumbs in the same spot. In that case it will wait for enough movement in the x direction to determine which thumb to pick.
PiperOrigin-RevId: 292353858
2020-01-31 11:13:06 -05:00
cketcham
a6e28bef76
Add support for multiple Slider thumbs
...
Resolves https://github.com/material-components/material-components-android/issues/916
PiperOrigin-RevId: 292135289
2020-01-29 16:14:10 -05:00
haodong
bb34f717df
Refactor trackColor attribute into common resources.
...
PiperOrigin-RevId: 291983432
2020-01-29 15:32:01 -05:00
cketcham
9e4ff3009f
Refactor handling of the thumb position to prepare for multiple thumb support
...
PiperOrigin-RevId: 289482135
2020-01-13 15:05:21 -08:00
haodong
fa4dc3d038
Fixed crash with NullPointerException when set value before laid out in Slider.
...
PiperOrigin-RevId: 288945151
2020-01-10 09:07:35 -08:00
haodong
9bbcd2d7ae
Fixed no OnChangeListener fires when value changed with single click.
...
Fixed set same values triggering listener.
Resolves https://github.com/material-components/material-components-android/issues/716
Resolves https://github.com/material-components/material-components-android/issues/853
PiperOrigin-RevId: 288608132
2020-01-08 11:57:33 -08:00
cketcham
7691797c2f
Allow clients to set their own OnFocusChangeListener on Slider
...
Fixes https://github.com/material-components/material-components-android/issues/844
PiperOrigin-RevId: 288403285
2020-01-07 13:34:44 -05:00
ruben
cde09d4b4e
[Slider] Add missing functionality from SeekBar regarding touch events and value changes
...
Resolves https://github.com/material-components/material-components-android/pull/831
GIT_ORIGIN_REV_ID=70dd0a10ef204837b01ed9593cfdd9bcf9137228
Co-authored-by: cketcham <cketcham@gmail.com>
PiperOrigin-RevId: 287545665
2019-12-30 14:15:50 -05:00
cketcham
a011ace28f
Remove ticksCoordinates from SliderState
...
There's no point in caching ticksCoordinates since it will have to be recalculated based on the new width once it's laid out again.
Resolves https://github.com/material-components/material-components-android/issues/793
PiperOrigin-RevId: 287363665
2019-12-30 14:14:55 -05:00
cketcham
9ae1494597
Add option to hide the Slider's label
...
This creates 3 options, to have the label floating, within the bounds of the view, or not shown.
Resolves https://github.com/material-components/material-components-android/issues/703
PiperOrigin-RevId: 287244827
2019-12-30 13:31:52 -05:00
cketcham
354edd09f4
Rename method in Slider
...
PiperOrigin-RevId: 286912170
2019-12-23 15:43:11 -05:00
cketcham
df61bff112
Fixed halo rendering bug for Slider
...
Using a hardware layer was causing problems in some versions of Android when drawing the halo ripple. Hardware layer really only needs to be used when the slider is disabled.
PiperOrigin-RevId: 286640042
2019-12-21 08:51:03 -05:00
cketcham
e38d260d69
Prevent unnecessary invalidation for Slider if the values haven't changed
...
PiperOrigin-RevId: 286632473
2019-12-21 08:50:33 -05:00
cketcham
5f631d48f0
Fix logic for when to draw Slider's compat halo
...
PiperOrigin-RevId: 286629247
2019-12-21 08:50:09 -05:00
cketcham
d8641182f9
Remove call to Slider's requestDisallowInterceptTouchEvent(false) in ACTION_UP
...
On the start of a new touch event on the parent, this will be reset.
PiperOrigin-RevId: 286623951
2019-12-21 08:49:30 -05:00
cketcham
3e212efdc2
Add getters and setters for colors for Slider
...
Resolves http://github.com/material-components/material-components-android/issues/770
PiperOrigin-RevId: 286472940
2019-12-21 08:47:32 -05:00
ruben
a7da96fac0
[Slider] Fixed behaviour when Slider is in a scrolling container
...
Resolves https://github.com/material-components/material-components-android/pull/833
GIT_ORIGIN_REV_ID=86b976f757fb8354ffe502c5acc32b6954890bb9
PiperOrigin-RevId: 286431744
2019-12-19 15:49:27 -05:00
cketcham
b2deaa3f22
Update the radius of the Slider RippleDrawable
...
PiperOrigin-RevId: 286239127
2019-12-18 15:56:40 -05:00
cketcham
dc17035a8b
Fix height of Slider when floating label is false
...
PiperOrigin-RevId: 286201599
2019-12-18 15:55:40 -05:00
cketcham
f28cc095a7
Reorganized and updated comments in Slider
...
PiperOrigin-RevId: 286194091
2019-12-18 15:54:30 -05:00