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

[Slider] Dynamic Step Size

Open alqudri99 opened this issue 3 years ago • 0 comments
trafficstars

Is your feature request related to a problem? Please describe. Yes, so there a few exception in this slider like "EXCEPTION_ILLEGAL_DISCRETE_VALUE", "EXCEPTION_ILLEGAL_STEP_SIZE" and "EXCEPTION_ILLEGAL_VALUE" i know there must be reason for this exception. But, is there a change that we can improve the logic? or just erase it? cause i already fork this and do some changes on the BaseSlider that i commented function that related to trigger the exception above, and the result is nothing happen, and guest what? what i want to achive is achieved. So, can i have some suggestion to this problem?.

how to Reproduce : valueTo = 45 stepSize = 1

what i want to achive is, i can add or substract the ticks with this formula : if if need 45 ticks use 1f as a step and if i need 12 ticks i will set the step to valueTo/12

Describe the solution you'd like the solution from me is, maybe we can improve the logic for that validation blocks. And i will appreciate if you can explain to me why we need that validation, cause i really confusion, why? when i change it it just lands on tick to. to be clear, i dont need ticks to show, i just need the discrete effect when its slide. so my suggestion is, can whe only activate this validation only when the ticks is show? same as this logic to tickCount = Math.min(tickCount, trackWidth / (trackHeight * 2) + 1); it will much better to only activate this when user show the ticks i think, cause it what it does right?.

Describe alternatives you've considered the alternative that i think just now is, maybe we can make an open class for validation that return list of what validation that we need to intercept to its super

Additional context https://user-images.githubusercontent.com/69712318/187828115-41ffabce-ee7d-42c0-8b4c-dad592855626.mov

Thanks, and forgive me if there some word that might be offense or something.

alqudri99 avatar Sep 01 '22 03:09 alqudri99