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

Issue with scrolling - when recyclerview horizontally LinearLayoutManager.HORIZONTAL #74

Open
vandanabpatel opened this issue May 30, 2019 · 1 comment

Comments

@vandanabpatel
Copy link

vandanabpatel commented May 30, 2019

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" />

@kochchy
Copy link

kochchy commented Dec 11, 2019

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

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

No branches or pull requests

2 participants