Smiley Rating
SmileyRating is a simple rating bar for android. It displays animated smileys as rating icon.
- Drawn completely using android canvas
- Inspired by Bill Labus
Demo

Integration
Integrating SmileyRating in your project is very simple.
Step 1:
Add this dependency in your project's build.gradle file which is in your app folder
add this to your dependencies.
Step 2:
Now place the SmileyRating in your layout.
Note: The height of the SmileyRating will be automatically adjusted according to the width of this component.
Step 3:
Initialize your view
Set this SmileySelectionListener to get notified when user selects a smiley
By default the selected smiley will be NONE
If you want to know the level of user rating, You can listen for OnRatingSelectedListener
Get current selection
this will return you an int value which indicated the current selected smiley
Get current rating level
You can set selected smiley without user interaction
Without animation
OR
The smiley will be selected without any animation and the listeners won't be triggered
With animation
Smiley will be selected with animation and listeners will also be triggered(Only if the second param is true)
You can even set the smiley to NONE with/without animation by passing NONE using same API.
You can change the smiley name also
Raw string
String resources
Custom font
You can change the title color of smileys.
Change colors
You can set change the colors by xml
Params | Description |
---|---|
app:angryColor |
To set the color of the Angry/Terrible smiley's background color. |
app:normalColor |
To change the color of all smileys background color except Angry/Terrible smiley. |
app:drawingColor |
To change the color of all smileys (Smile and eyes). |
app:placeHolderSmileColor |
To set the color of all placeholder smiley's (Smile and eyes) color. |
app:placeHolderBackgroundColor |
To set the color of all placeholder smiley's background color. |
app:textSelectionColor |
To set the color of the selected smiley's text color. |
app:textNonSelectionColor |
To set the color of the non-selected smiley's text color |
app:isIndicator |
A boolean to switch modes between editable and non editable bar |
Or, you can change colors on runtime also
All colors should have be provided as color int.
Example
Show/Hide line
You can customize wheather to show or hide the line behind smileys.
or
passing true will show the line and passig false will hide the line. You can get the current visibility of the line by calling
Indicator
To set the mode of the RatingBar.
java mSmileyRating.setIndicator(false);
passing false will allow the user to set smiley rating. passing true will make the RatingBar just an inticator which is untouchable and will be used to just show some rating by default.