williamyyu/SimpleRatingBar

Issue with scrolling - when recyclerview horizontally LinearLayoutManager.HORIZONTAL

vandanabpatel opened this issue · 1 comments

while scrolling rating is not displaying stars are fade
i want to display no of star and rating programatically in adapter
like.. from response if i am getting 3 value then
my no. of star will be 3 and rating also 3

code is=========
rvReview.setLayoutManager(new LinearLayoutManager(mActivity, LinearLayoutManager.HORIZONTAL, false));

adapter===
if (object.getRatings().getRating() > 0) {
layoutBinding.rbRating.setVisibility(View.VISIBLE);
layoutBinding.rbRating.setNumStars( object.getRatings().getRating());
layoutBinding.rbRating.setRating(object.getRatings().getRating());
} else {
layoutBinding.rbRating.setVisibility(View.INVISIBLE);
}

xml===
<com.willy.ratingbar.BaseRatingBar
android:id="@+id/rb_rating"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center"
app:srb_drawableEmpty="@drawable/ic_rating"
app:srb_drawableFilled="@drawable/ic_rating_seletced"
app:srb_isIndicator="true"
app:srb_starHeight="@dimen/rating_size_small"
app:srb_starPadding="@dimen/_1sdp"
app:srb_starWidth="@dimen/rating_size_small"
app:srb_stepSize="1" />

hello. just call
layoutBinding.rbRating.setRating(0);
before
layoutBinding.rbRating.setRating(object.getRatings().getRating());