williamyyu / SimpleRatingBar

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

Set SimpleRatingBar lockable #11

Closed aurelhubert closed 7 years ago

aurelhubert commented 7 years ago

Hi again,

Last suggestion, you should add a lockable state to just diplay the rating bar & disable the touch event. To do it, just add a parameter:

private boolean isLocked = false;

In the onTouchEvent:

@Override
public boolean onTouchEvent(MotionEvent event) {

        if (isLocked) {
            return true;
        }
        ...
}

And the getter/setter:

public boolean isLocked() {
    return isLocked;
}

public void setLocked(boolean locked) {
    isLocked = locked;
}

Thanks! 👍

williamyyu commented 7 years ago

Hello, I just added this feature in newest release(v1.2) hours ago XDD but still thanks for your suggestion!