Skip to content

Commit

Permalink
Minimum rating should be one star
Browse files Browse the repository at this point in the history
  • Loading branch information
itsyourap committed Jun 20, 2024
1 parent 04da147 commit beb2299
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions app/src/main/java/sayan/apps/numplex/FeedbackFragment.kt
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,12 @@ class FeedbackFragment : Fragment(), View.OnClickListener {
val feedbackText = feedbackEditText.text.toString()
val ratingValue = ratingBar.rating.toDouble()

if (ratingValue < 1) {
Toast.makeText(requireActivity(), "Please provide a rating!", Toast.LENGTH_SHORT)
.show()
return
}

val account = GoogleSignIn.getLastSignedInAccount(requireActivity())
val userId = account?.email ?: "defaultUserId"

Expand Down

0 comments on commit beb2299

Please sign in to comment.