-
Notifications
You must be signed in to change notification settings - Fork 7
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
[CU-19bjtt] Rating text color is variable #89
Conversation
textview rating color changes on the basis of rating
@@ -393,6 +393,22 @@ class PublicRestaurantProfileActivity : BaseActivity(), AppBarLayout.OnOffsetCha | |||
} else "-" | |||
} ?: "-" | |||
tvRating.text = restaurantModel.formatRating() | |||
val ratingtext: String = tvRating.text.toString(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why don't you use restaurantModel.rating
on RHS of assignment? Then you don't need to cover it back to float.
updated public restaurant rating color
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@sanyud24 please check that CI check is failing for this PR.
That means this PR code cannot even build. Please fix it by running your code on your phone locally before pushing the code.
Task linked: CU-19bjtt Rating text color is variable |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What's the point of deduplicating code if you're still writing same if-else block twice? 🙄
Plus, I mentioned creating the extension functions on the data classes so you don't need to pass data.ratings
explicitly. And the function will return the color integer value (like R.color.apple_green
) rather than setting it on its own.
couldnt figure out where to call the function
Superseded by #101 |
textview rating color changes on the basis of rating