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

If we click between the two stars, both star will get clicked #75

Open
shubham696 opened this issue Dec 18, 2020 · 8 comments
Open

If we click between the two stars, both star will get clicked #75

shubham696 opened this issue Dec 18, 2020 · 8 comments
Assignees
Labels

Comments

@shubham696
Copy link

shubham696 commented Dec 18, 2020

WhatsApp Image 2020-12-28 at 12 53 37 PM

When i click between 2 & 3 star (highlighted by blue color), both are getting selected

XML code:-
<me.zhanghai.android.materialratingbar.MaterialRatingBar
android:id="@+id/feedbackRatingBar"
style="@style/customRatingBar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:indeterminateTint="#FFCB07"
android:numStars="3"
android:progressTint="#FFCB07"
android:secondaryProgressTint="#00000000"
android:stepSize="0.01" />

Code:
feedbackRatingBar?.setOnRatingBarChangeListener { _, rating, fromUser ->
if(fromUser){
feedbackRatingBar?.rating = ceil(rating)
}
}

@zhanghai
Copy link
Owner

Duplicate of #28?

@shubham696
Copy link
Author

None of the solution worked for me from #28 @zhanghai

@zhanghai
Copy link
Owner

Could you illustrate your issue with a screenshot? Where did the click happen and what was the unexpected behavior?

@zhanghai zhanghai self-assigned this Dec 19, 2020
@zhanghai
Copy link
Owner

Closing for inactivity.

@shubham696
Copy link
Author

Closing for inactivity.

@zhanghai i already added all the require things, Why you closed it without solution

@zhanghai
Copy link
Owner

Oh, I didn't notice your edit. But still, where exactly did the click happen?

@zhanghai zhanghai reopened this Dec 25, 2020
@shubham696
Copy link
Author

Closing for inactivity.

Please check updated the image & highlighted clicked area

@zhanghai
Copy link
Owner

zhanghai commented Dec 28, 2020

Your code looks reasonable to me and I don't have a good idea why it doesn't work for you. I would suggest debugging it more, e.g. printing the ratings received & set in the listener to logcat and see if they are the expected values.

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

No branches or pull requests

2 participants