-
-
Notifications
You must be signed in to change notification settings - Fork 38
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
MOBILE-188/Features such as recommend,review in profile screen #366
MOBILE-188/Features such as recommend,review in profile screen #366
Conversation
metadata = metadata, | ||
onRecommend = { | ||
try { | ||
socialViewModel.recommend(metadata) |
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.
This is wrong, we do not propagate errors to the UI right now so this will always result in a successful toast. If you want, you can propagate the error via Resource
class and then check if the response was successful then return error. We can ditch errorFlow for this as well.
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.
Remember its okay to change the core code if you feel its right. At most I will say is "This is wrong" and you will learn a thing or two. Great work overall.
Dialog.NONE -> Unit | ||
Dialog.PIN -> { | ||
PinDialog(trackName = listens[currentIndex!!].trackMetadata.trackName, artistName = listens[currentIndex].trackMetadata.artistName, onDismiss = deactivateDialog, onSubmit = { | ||
blurbContent -> try { |
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.
Same here as well. Please take care everywhere you've done this.
Also, can we please use Snackbar instead of toasts. I will choose the same on feed as well so it makes sense we have it here. |
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.
Great work! After these last set of changes, I think we would be good to go :)
app/src/main/java/org/listenbrainz/android/ui/screens/listens/ListensScreen.kt
Outdated
Show resolved
Hide resolved
@07jasjeet Please review the updated PR when u r able! Thanks :) |
I think we can improve on the structure by just using one flow but LGTM for now. @akshaaatt good to merge. |
@@ -35,6 +35,11 @@ object Constants { | |||
const val REFRESH_TOKEN = "refresh_token" | |||
const val STATUS_LOGGED_IN = 1 | |||
const val STATUS_LOGGED_OUT = 0 | |||
const val RECOMMENDATION_GREETING = "Song recommended successfully!" |
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.
@pranavkonidena Please move these to the strings file in res. That would enable us to be able to translate these.
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.
@pranavkonidena please remove the strings from Constants and use them directly from res/strings
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.
@akshaaatt So sorry , I misunderstood what I needed to do.. hopefully it is fixed now
Link to ticket
https://tickets.metabrainz.org/browse/MOBILE-188?filter=-2
Problem
The features in the feed such as writing review , recommend etc were not present in the profile screen even tho the listen cards were there. This made it very bland, hence I refactored so that those features can be done from the profile screen as well!
Solution
I used the socialViewModel and called fns for pin and recommend to followers directly. For review and personal recommendation, I had to use feedViewModel as well for filtering out user's followers and had to make a dialog system as was done for the feed. Also , I made sure a toast (snackbar) is displayed every time a successful event is triggered so that the user gets feedback as well. I have added those messages inside constants file as they may be reused.
Demo
2024_02_15_18_27_37.1.1.mp4