material-components / material-components-android

Modular and customizable Material Design UI components for Android
Apache License 2.0
16.28k stars 3.06k forks source link

[Slider] Add support for secondary track #1866

Open Tolriq opened 3 years ago

Tolriq commented 3 years ago

Is your feature request related to a problem? Please describe.

I want to be able to show the cache buffer in a slider that allows to control a player. The value is informational and should not limit the ability to slide to values larger than the buffer.

Describe the solution you'd like Behave like SeekBar and propose a secondary track to represent that value to users.

Describe alternatives you've considered As all is private there's no way to implement that by extending the slider, alternative are seekbar with custom labels.

wcshi commented 3 years ago

Hi @Tolriq could you please share a mock of what you had in mind?

Tolriq commented 3 years ago

More or less like the normal android SeekBar/ProgressBar when using secondary Progress

https://developer.android.com/reference/android/widget/ProgressBar.html#attr_android:secondaryProgress

Defines the secondary progress value, between 0 and max. This progress is drawn between the primary progress and the background. It can be ideal for media scenarios such as showing the buffering progress while the default progress shows the play progress.

image

But handling of the round corners and all the shiny material :)

matpag commented 3 years ago

This would be a nice feature to have. It would solve the Slider as "track player" use case.

dovahkiin98 commented 3 years ago

It's a nice feature, but doesn't adding a Slider with a LinearProgressBar below it give the same behavior and look?

Tolriq commented 3 years ago

Not at all, proper positioning is complex due to rounding issues, it adds another view and most important it's drawn under so you always have the slider inactive track paint over when the wanted effect is the opposite.

jimiduiveman-npo commented 1 year ago

This feature would make sense indeed, what are the latest findings on this request?

MusabAlothman commented 1 year ago

Agree, feature is needed

ag2s20150909 commented 1 year ago

Agree, feature is needed

Ygor8686 commented 1 year ago

****

Ygor8686 commented 1 year ago

I'm an .com.droit'

Ygor8686 commented 1 year ago

layout: index lang: en