williamyyu / SimpleRatingBar

A simple RatingBar that you can easier to customize image and animations
MIT License
1.36k stars 153 forks source link

Clear rating when selecting the same rating #10

Closed aurelhubert closed 7 years ago

aurelhubert commented 7 years ago

Hi,

Thanks for the library, simple but exactly what we need for a rating bar. One small question: is it normal that the rating is cleaned when the user select twice the same rating? I think this behavior is quite a bit strange. In the onTouchEvent(MotionEvent event) method:

if (mPreviousRating == rating) {
    clearRating();
} else {
    setRating(view.getId());
}

I think the user should decide about this behavior.

williamyyu commented 7 years ago

Hello,

Thanks for your response! I'll add a method to let user decide whether clearRating when select twice the same rating.