Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OnRatingBarChangeListener is not raised! #9

Closed
etymontechnologies opened this issue Apr 18, 2017 · 1 comment
Closed

OnRatingBarChangeListener is not raised! #9

etymontechnologies opened this issue Apr 18, 2017 · 1 comment
Assignees

Comments

@etymontechnologies
Copy link

When I set rating to 6, MaterialRatingBar does not raise OnRatingChangeListener!!

<me.zhanghai.android.materialratingbar.MaterialRatingBar
        android:id="@+id/ratingBar"
        android:layout_width="260dp"
        android:layout_height="24dp"
        android:numStars="10"
        android:rating="6"
        android:stepSize="1"
        />
MaterialRatingBar ratingBar = (MaterialRatingBar) findViewById(R.id.ratingBar);
ratingBar.setOnRatingChangeListener(new MaterialRatingBar.OnRatingChangeListener() {
            @Override
            public void onRatingChanged(MaterialRatingBar ratingBar, float rating) {
                Log.d("Test", String.format(Locale.US, "Rating: %f", rating));
            }
        });
ratingBar.setRating(6);
@zhanghai
Copy link
Owner

This is working as intended, the same as framework ProgressBar -- Setting the same value again won't trigger listeners, as setRating() will call setProgressInternal() which simply returns after the check.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants