sujithkanna / smileyrating Goto Github PK
View Code? Open in Web Editor NEWSmileyRating is a simple rating bar for android. It displays animated smileys as rating icon.
License: Apache License 2.0
SmileyRating is a simple rating bar for android. It displays animated smileys as rating icon.
License: Apache License 2.0
It's a marvelous library, thanks!
I know, to get current rating level, is by adding int level = mSmileRating.getRating();
.
But my case is, I want to send current rating level into MySql database.
If it an EditText type, I know we have to create API first by using Volley to make communication between Android and MySql database. It works well because it's a String data type.
But how if the rating of the Smiley that has an int data type?
How to send it?
Do you have any idea?
Currently, I'm using Mysql as database and I use PHP as server-side program language to create API, to connect between Mysql database and Android inputs.
Much appreciate any helps, thanks!
How to change the smiles order
It is possible to change the color in each smile?
I tried the Bar on a cellular device where I connected a bluetooth, but when I want to move through the faces, I could not.
Can you make the bar compatible with control navigation?
I want to rate 1.5, 2.5, etc.
When i use smileRating.setSelectedSmile(BaseRating.GREAT); it makes the view invisible(only partially visible on the left) but the rest of the rating work okay during the initialization of the view .When you tap on any rating it reverts to the normal state.Cheers.
Hi guys! You are making such a great job, i really like your library. I am detect an issue when is select the New Smile, it doesn't show it. Also doesn't show when the smileRating.setSelectedSmile is loaded.
Android version: 5.1.1
Model number: SM-J120M
compile 'com.github.sujithkanna:smileyrating:1.6.7'
But when i select another Smile and come back with the New, in that case it is show it
How to set custom font for textSelection and textNonSelection
I want to unselect smiley on rating is sent.
I used smileRating.setSelectedSmile(BaseRating.NONE); which worked but after using this functionality angryColor do not reflect and BaseRating.GREAT animation is not working fine.
Please suggest any solution for the same.
Hi,
I see snapping is working properly only if the initial rate is >= 0
but if it is -1 (NONE) sliding can be ended at the middle of any icon and setOnSmileySelectionListener is not called.
please take a look.
I need to remove the "Okay" rating level, so the user can only rate either "positive" or "negative" feedback. I am wondering how to achieve this kind of workaround.
Thank you.
Hi, thanks for a cool library!
How can I set a text size after I changed Typeface?
thanks
The only smiley color you can change individually is the angry one.
smileyRating.setAngryColor(int color);
The other option is to change all the color of all smileys except Angry/Terrible smiley.
smileRating.setNormalColor(int color);
Is there a way to change individually other smiley, like great smiley?
i want to set distinct color for all 5 smilies, how can i do it. Any help would be appreciated
values returned by getRating()
range from 1 to 5, with 0 for none selected
but values expected by setSelectedSmile
range from 0 to 5 with -1 for non selected
This makes it hazardous to store and display values through the scale :
if you store as int userSatisfaction
the value from
the level
variable inside the onRatingSelected
of a SmileRating.OnRatingSelectedListener
and later you want to display a scale with the same value, you have to set it like :
SmileRating.setSelectedSmile(userSatisfaction -1);
to adapt the range offset... this is quite unintuitive
This is not an issue per se but I spent quite some time thinking the #22 was not really fixed when in fact I was setting my SmileRating to level 5, which does not exist...
Anyway, many thanks for your great work!
Not able to set rating manually inside BottomSheetDialog. Every time I set the rating to 4 it resets to 1 when showing the bottom sheet.
EDIT not able to set rating even in the alert dialog
what is difference between smileyrating and smilerating
Hi.
I'm trying to change name of Smiles and it throws null object reference;
here is my code in a fragment.
final RatingDiaglogClass ratingDiaglogClass = new RatingDiaglogClass(contextHolder, R.style.RatingDialogTheme);
LayoutInflater inflater = (LayoutInflater) contextHolder.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
View dv = inflater.inflate(R.layout.layout_rating_dialog, null);
ratingDiaglogClass.setContentView(dv);
final SmileRating smileRating = view.findViewById(R.id.smile_rating);
smileRating.setNameForSmile(BaseRating.BAD, "sthElse");
ratingDiaglogClass.show();
This is the error:
Attempt to invoke virtual method 'void com.hsalf.smilerating.SmileRating.setNameForSmile(int, java.lang.String)' on a null object reference
Is it possible to change smiley icon and corresponding text of it?
The text is not drawn smoothly.
I have set setIndicator to false, also implemented click listeners, but still they are not clickable. Its a very weird behaviour, sometimes they work and some times they don't.
It would be nice to be able to change the text colors (black/gray) in XML or in Java code.
Could you implement that?
Thanks!
Hello,
first of all thanks for the great library, it is really helpful.
I want to ask if it is possible to change the text under the faces.
Thanks!
Hi!
First of all, thanks for your work in this!
A slight improvement might be making the text color a variable as well.
I will make a pull request for this somewhere this week!
Edit: It seems to be documented but non functional?
Great work!
Adding support for the android:isIndicator property would make even better as right now you need to extend and override some of the methods just to disable the user actions.
how set programatic a rating.
SmileRating.setRating() does not exist.
Hi I tried this awesome library and I would like to know how to take default value set in it or initially none should be chosen on smileyRating when user done interacts.
Hi, sujithkanna, how i can use the library with inverse order?
It's a marvelous library, thanks!
I know, to get current rating level, is by adding int level = mSmileRating.getRating();.
But my case is, I want to send current rating level into MySql database.
If it an EditText type, I know we have to create API first by using Volley to make communication between Android and MySql database. It works well because it's a String data type.
But how if the rating of the Smiley that has an int data type?
How to send it?
Do you have any idea?
Currently, I'm using Mysql as database and I use PHP as server-side program language to create API, to connect between Mysql database and Android inputs.
Much appreciate any helps, thanks!
When we use this rating in recyclerview item and try to move emoji, it get stuck between 2 emoji's. Please tell me how i can resolve this?
i try set rating from kotlin silimar your description in my fragment but it not Work
my code is:
smileyRating.setRating(3, true)
I'm trying to setRating(SmileyRating.Type.GREAT.rating, true) in kotlin similar to your description but it not work for me, and always TERRIBLE is selected what is my mistake?
` smileyRating.setFaceBackgroundColor(SmileyRating.Type.TERRIBLE, Color.RED)
smileyRating.setFaceBackgroundColor(SmileyRating.Type.BAD, 0xFFFF8606.toInt())
smileyRating.setFaceBackgroundColor(SmileyRating.Type.GREAT, 0xFF50DA30.toInt())
smileyRating.setFaceBackgroundColor(SmileyRating.Type.OKAY, 0xFFF3C641.toInt())
smileyRating.setRating(SmileyRating.Type.GREAT.rating, true)
smileyRating.setTitle(SmileyRating.Type.TERRIBLE, "Worst pain")
smileyRating.setTitle(SmileyRating.Type.BAD, "Very Severe")
smileyRating.setTitle(SmileyRating.Type.OKAY, "Moderate")
smileyRating.setTitle(SmileyRating.Type.GOOD, "Mild")
smileyRating.setTitle(SmileyRating.Type.GREAT, "No Pain")
`
also, I try and it not work
smileyRating.setRating(3, true)
I want Rating bar to have no selected rating in the start..
let me know if rating bar has this functionality
how to insert link php ?
How i implement this in Adapter?
Hi @sujithkanna.
First of all, this is a really good library. Using this for a college project and I guess i'll surely use this in the future. Coming to the problem I faced, I wanted to clear the selection after a button click and I couldn't get that to work. Even after reading the documentation I couldn't find a way around this. After playing around for a while, the easiest way to acomplish this would be to set the setSelectedSmiley() function to -1, i.e, smileyRating.setSelectedSmiley(-1);
Doing this cleared the selection off. This could be handy when it comes to submitting a survey or a rating in general and you would want to clear the selection after submission.
Just wanted to raise a solution/info.
Thanks for the cool library. Cheers (y)
Hey! It's been great work. Is it possible to change picture rather than smiley face ?
How to change the orientation of SmileyRating from "horizontal" to "vertical" ?
Icons are not clickable. Not able to select or rate them.
Programmatically they are selected, but on touch its not getting selected.
minsdkversion 21
targetsdkverison 28
First I got this error:
https://stackoverflow.com/questions/51812994/onunhandledkeyeventlistener-class-not-found
After fixing the above. Stack trace is normal. Its saying
I/RatingView: Selected smile:Terrible
I/RatingView: ******************
Your work is awsome! but now I need to make it work :) I follow the 3 steps in the usage part and I see the smilies in the designer preview. I did the following in an adapter:
RatingViewHolder(View itemView) {
super(itemView);
srRating = (SmileRating) itemView.findViewById(R.id.smile_rating);
srRating.setIndicator(true); //<< srRating is not null and this line works
}
@OverRide
public void onBindViewHolder(final RatingViewHolder holder, int position) {
Rating theRating = RatingList.get(position);
holder.srRating.setSelectedSmile(5,true); << fails*
}
Please advice, it seems that this is working for everyone so I wonder if I miss something
Thanks
Hi @sujithkanna !
It's possible change order to the faces?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.