material-components-android icon indicating copy to clipboard operation
material-components-android copied to clipboard

[Slider] Hide dots instead of limiting the number

Open mueller-ma opened this issue 4 years ago • 2 comments

Description: If a discrete slider would display too many dots, the number of dots is reduced. However isn't this against the meaning of the dots? IMO a dot has the meaning of: This is a slider that you cannot drag to any position, but to this position I (the dot) mark.

Expected behavior: I suggest to check how many dots need to be displayed and if that's too much, hide them instead of limit them.

Source code: None needed

Android API version: Every

Material Library version: 1.2.0-alpha06

Device: Every

mueller-ma avatar Apr 22 '20 11:04 mueller-ma

+1, it's really confusing.

@drchen, I think I could resolve the issue, but I would like to know what do you think the fix should look like? For example, we could add something like tickOverflowBehavior with "show some ticks if they are too dense" and "hide ticks if they are too dense". Or, we could create something like tickVisibilityMode with 3 options: "don't show ticks", "show ticks, but hide them if too dense", and "show ticks, but if ticks are too dense, show only some of them" (in this case, tickVisible is no longer needed and can be deprecated).

pubiqq avatar Aug 01 '22 14:08 pubiqq

Hi @pubiqq,

I think adding a tickVisibilityMode enum makes a lot of sense to me to solve this issue. We can probably have ALWAYS, AUTO (default), and GONE. (Or any names that make more senses.)

It will be greatly appreciated if you are willing to help on creating the solution. : )

drchen avatar Aug 01 '22 14:08 drchen