material-components / material-components/material-components-android

[Slider] Separate control over active and inactive track heighs

Open
#2,336 0 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

feature request Widget: Slider
Dominant language
Java
Stars
17.4k
Forks
3.2k
PR merge metrics
No merged PRs in 30d

Description

Material specification allows to control active and inactive track heights separately – https://material.io/components/sliders#specs. I'd like to see this in the `Slider` class as well.

https://github.com/material-components/material-components-android/blob/0e5c3932cb790ef40a632bea69fc9b2035552345/lib/java/com/google/android/material/slider/BaseSlider.java#L1147-L1153

https://github.com/material-components/material-components-android/blob/0e5c3932cb790ef40a632bea69fc9b2035552345/lib/java/com/google/android/material/slider/BaseSlider.java#L2051-L2056

I think the optimal solution would be to add two additional properties – `inactiveTrackHeight` and `activeTrackHeight`. They would have separate getters and setters. Current `trackHeight` could control both of them. Optionally it could be deprecated.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reading the Slider implementation and the referenced sections of BaseSlider.java to understand the existing trackHeight behavior. Add separate activeTrackHeight and inactiveTrackHeight getters and setters while preserving trackHeight control over both; done means the two track segments can be configured independently.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
mobile
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.