I have seen that a rating scale is always a several star or any other drawable image. I want to make a continuous bar line from 0-10 taht the user will hit on some point of it and I get the colses rate
Asked
Active
Viewed 635 times
1 Answers
0
Look into the SeekBar documentation. You can add one to your layout and allow the user to drag the slider to give their "rating". In your XML layout file, add something like this:
<SeekBar
android:id="@+id/seekbar"
android:width="match_parent"
android:height="wrap_content"
android:min="0"
android:max="10"
android:progress="5" />
(The android:progress
sets the initial state of the SeekBar, which in this case is exactly in the middle. The user can then change it as desired by sliding the "thumb".)
Then, in your code, set an OnSeekBarChangeListener
and react accordingly when the user changes the rating. Or just call getProgress()
on the SeekBar object to get the rating once the user is done with your form.

drmercer
- 430
- 8
- 11
-
Thanks.I will use it. And to make the line with some color I just use android:backcolor? And if I want to change the shape of the slider, Do I have a drawable opion for this? – Bar Strauss Nov 20 '15 at 19:39
-
Great. If it answers your question, mark it as the accepted answer so other users know this question has already been answered. – drmercer Nov 21 '15 at 14:08
-
Sorry, somehow I didn't see the rest of your comment. Yes, you can change the colors and drawable used. Check the documentation at for more specific information about SeekBar (I linked to it in my answer). – drmercer Nov 21 '15 at 22:39