williamyyu / SimpleRatingBar

A simple RatingBar that you can easier to customize image and animations
MIT License
1.36k stars 153 forks source link

Listener not working on DialogFragment #89

Open vinchenson opened 4 years ago

vinchenson commented 4 years ago

Hello again, I have this code on a dialog fragment:

ScaleRatingBar ratingBar = new ScaleRatingBar(requireContext()); ratingBar.setNumStars(5); ratingBar.setMinimumStars(1); ratingBar.setRating(3); ratingBar.setStarPadding(5); ratingBar.setStepSize(0.5f); ratingBar.setStarWidth(105); ratingBar.setStarHeight(105); ratingBar.setIsIndicator(false); ratingBar.setClickable(true); ratingBar.setScrollable(true); ratingBar.setClearRatingEnabled(false); ratingBar.setEmptyDrawableRes(R.drawable.new_star_empty); ratingBar.setFilledDrawableRes(R.drawable.new_star_full); ratingBar.setOnRatingChangeListener(new BaseRatingBar.OnRatingChangeListener() { @Override public void onRatingChange(BaseRatingBar ratingBar, float rating, boolean fromUser) { Log.e(TAG, "onRatingChange: " + rating); } });

When the app is running and dialogfragment is shown, whenever I touch the stars, the log.e error does not show into logcat.

What might be the issue?

grrigore commented 3 years ago

I'm having the same problem. Any fixes?