'Android - how to put 5 different Smiley in Rating Bar
I am creating a form in which i have to put five different smiley icon in rating bar to get feedback from user.
I tried but at a time only one type of icon is being displaying.
I am trying by changing style in style.xml
<style name="customRatingBar" parent="@android:style/Widget.RatingBar">
<item name="android:progressDrawable">@drawable/ratingstars</item>
<item name="android:minHeight">32dip</item>
<item name="android:maxHeight">32dip</item>
</style>
Please suggest me how could we achieve this in android?
Thanks in advance.
Solution 1:[1]
Here is a ratingbar which uses face morphing animation to animate different smiley reactions.
SmileyRating github
You can clearly see that the smiley is changing its reaction slowly.
Solution 2:[2]
From my experience with RatingBar I would say ditch it completely and implement your own mechanism for getting the feedback. Maybe a horizontal linear layout with 5 circular buttons?
Solution 3:[3]
I had the same problem and the only way I found is to make a LinearLayout with the 5 different faces as elements, and manually control touch position to change faces from selected to unselected, emulating how an old plain android RatingBar works.
I recently made a library out if this implementation, maybe it can help you.
An example of the library working with faces:
Solution 4:[4]
Checkout this EmojiRatingBar library.

Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | |
| Solution 2 | Harry Detsis |
| Solution 3 | inlacou |
| Solution 4 | Unaisul Hadi |


