Closed zouzoux closed 8 years ago
Hi @zouzoux, I'm not sure this is a real bug. The reasons are:
1.onTouchListener
is supposed to be called multiple times, that's how you get each of the MotionEvents actioned on the view. From what you wrote, it seems you are not using it for it's original purpose.
OnRatingBarChangeListener
. What do you mean by another user?This said, if you find any part of the code in the SimpleRatingBar that can be optimized for better performance you can:
When I rate a post , the rating is sent to parse server database but the thing is when I only tap once onTouchListener keep executing and sending the same rating over and over again what I mean by another user is that someone else using another phone can rate the same post and change the average rating which will execute onRatingBarChangeListener and so a rating will be send from me even tough I did not rate anything....
Ok, I think I understand now. But anyway, you shouldn't be using onTouchListener, it's not meant for that.
What you are missing is the fact that when the method onRatingChanged
of your listener is called the third parameter is a boolean which indicates:
setRating
or using an animation)It seems that the problem happens also with onRatingChanged because as soon as I tap once to rate the post, it keep on sending the same rating on and on. Note that I used the same code with the original star rating and it was working but I want to use your Rating bar because it's simply awesome...
@zouzoux can you post some minimal code so I can replicate your problem ? Are you using version 0.1.0 ? I have added to the sample app an example of usage of onRatingChanged, and it's working just fine (no duplicated calling).
Closing this issue due to inactivity. I also answered the same question in SO: link.
I am using a Recycler View where I have some posts you can rate them, I can't use onRatingbarChangeListener because another user might change the rating.... but when I use onTouchListener it executes too many times and also when I try to scroll down sometimes it takes time to display the average rating of the post, the animation is slow, is there somewhere we can chat like skype so we work on fixing it... Thank you!