A RatingBar is an extension of SeekBar and ProgressBar that shows a rating in stars. The user can touch/drag or use arrow keys to set the rating when using the default size RatingBar.
In this tutorial, we show you how to create custom RatingBar and use it in Android.
This project is developed in Eclipse 4.2.0.
1. Make main layout with some components.
By default the RatingBar have 5 stars icon to set the rating value and the step size default is 0.5. These default can be change by add some android attributes in xml layout like:
We custom RatingBar by define a new style for it
Create star_rating_bar_full.xml in drawable folder
2.1. When User click on RatingBar the selected rating value will be displayed in the textview
2.2. And if user clicks on the button, the value of RatingBar will set by 5 stars.
3.1. Click on RatingBar
3.2. Click on Button
You can download all source code of this tutorial at here