FlyingPumba / SimpleRatingBar

Open source project which features a simple yet powerful RatingBar alternative to Android's default
Apache License 2.0
1.03k stars 142 forks source link

Not working in recyclerView (epoxy) #39

Open carlosmuvi opened 6 years ago

carlosmuvi commented 6 years ago

Hey! first of all, great library, super flexible and easy to customize.

I'm trying to add a SimpleRatingBar view as part of an item in a RecylerView.

    @ModelProp fun setStarCount(starCount: Float?) = with(vehicle_rating) {
        show(starCount != null)
        starCount?.let { rating = starCount }
    }

The starCount binding is called properly, If I replace the SimpleRatingBar by a TextView for example, the rating is shown properly, but using the library it's always 0 stars (the setRating method is called with the correct values).

Any idea why that can be happening?

Thanks!

carlosmuvi commented 6 years ago

Solved - Epoxy was saving the view state calling saveViewHierarchy. Sorry about that!