Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
282 views
in Technique[技术] by (71.8m points)

android - Implementation of Google design guidelines for Sliders

Yesterday I was looking for sliders in Android and found this website with the Google search: https://material.io/guidelines/components/sliders.html#sliders-discrete-slider

I know that I can use a SeekBar in Android to implement sliders. However, Google seems to have very nice examples of discrete sliders but I cannot find any code examples.

I already implemented a normal SeekBar that is looking like this:

Focused SeekBar in Android

How can I make it look like this?

Focused SeekBar in Android from Google design guidelines

(Difference: When I move my slider, there is no big drop that shows the current value)

I think I might just have missed the code documentation for these design guidelines. Does anyone know where to find it? Or is the design difference because I got Android 5.0.2 on my phone?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

sadly google just provided how it should look like, but there seems to be no class provided by the android support libraries :(

but for now you can try this library: https://github.com/AnderWeb/discreteSeekBar

or this for even more material elements: https://github.com/navasmdc/MaterialDesignLibrary

hopefully google adds this in later releases...


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...