a914-gowtham / compose-ratingbar

ratingbar composable for jetpack compose :rocket::star2:
MIT License
240 stars 21 forks source link

Some way to know when the user is done selecting a rating #5

Closed FXeio closed 3 years ago

FXeio commented 3 years ago

In the future one might need to know when the swipe motion is completed and the finger is lifted from the screen (e.g. to open a review screen)

a914-gowtham commented 3 years ago

Yes, you are right. I need to check the possible ways to implement it.

a914-gowtham commented 3 years ago

I have made some changes to the onRatingChanged function. it will be called once ratingbar is clicked or drag is released as same as default behaviour of android ratingbar's setOnRatingBarChangeListener interface.

   implementation 'com.github.a914-gowtham:compose-ratingbar:1.0.4'
var rating: Float by rememberSaveable { mutableStateOf(initialRating) }

        RatingBar(value = rating,onRatingChanged = {
            rating=it
            //Navigation code
        })