material-components-android
material-components-android copied to clipboard
[Slider] Customize Tick for Discrete Slider
Is your feature request related to a problem? Please describe. I want the ability to customize the Tick drawable for my Slider, by sending the desired drawable asset
Describe the solution you'd like Instead of drawing only the default tick, I want to set a custom drawable shape to be used
Describe alternatives you've considered Currently, I didn't see any alternative to have this asset customizable.
Duplicate https://github.com/material-components/material-components-android/issues/935
@ymarian This is not related to the #935 that requests to change the Thumb Drawable, what I want is to change the Tick drawable for the Discrete Slider, that currently it's been drawing programmatically by this method:
private void drawTicks(@NonNull Canvas canvas) {
float[] activeRange = getActiveRange();
int leftPivotIndex = pivotIndex(ticksCoordinates, activeRange[0]);
int rightPivotIndex = pivotIndex(ticksCoordinates, activeRange[1]);
// Draw inactive ticks to the left of the smallest thumb.
canvas.drawPoints(ticksCoordinates, 0, leftPivotIndex * 2, inactiveTicksPaint);
// Draw active ticks between the thumbs.
canvas.drawPoints(
ticksCoordinates,
leftPivotIndex * 2,
rightPivotIndex * 2 - leftPivotIndex * 2,
activeTicksPaint);
// Draw inactive ticks to the right of the largest thumb.
canvas.drawPoints(
ticksCoordinates,
rightPivotIndex * 2,
ticksCoordinates.length - rightPivotIndex * 2,
inactiveTicksPaint);
}
Any info on this? Is it being considered or is there no plan on supporting this?
Any update on this?
Any update on this? + 2