From beb229958b66c6e3c0d75395dc191f43ac8e806a Mon Sep 17 00:00:00 2001 From: Ankan Pal Date: Thu, 20 Jun 2024 11:15:06 +0530 Subject: [PATCH] Minimum rating should be one star --- app/src/main/java/sayan/apps/numplex/FeedbackFragment.kt | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/app/src/main/java/sayan/apps/numplex/FeedbackFragment.kt b/app/src/main/java/sayan/apps/numplex/FeedbackFragment.kt index 617405e..4fbc1ab 100644 --- a/app/src/main/java/sayan/apps/numplex/FeedbackFragment.kt +++ b/app/src/main/java/sayan/apps/numplex/FeedbackFragment.kt @@ -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"