-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Fixed #4906 : Peer review: "thank the contributor" should show snackb… #4914
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
Conversation
…show snackbar instead of notification
Codecov Report
@@ Coverage Diff @@
## master #4914 +/- ##
============================================
- Coverage 51.42% 51.40% -0.02%
+ Complexity 2327 2324 -3
============================================
Files 345 345
Lines 16194 16196 +2
Branches 1430 1430
============================================
- Hits 8327 8326 -1
- Misses 7236 7237 +1
- Partials 631 633 +2
Continue to review full report at Codecov.
|
|
I just tried, this is pretty annoying, I feel like I can't press buttons because the snackbar just appeared... @neslihanturan any UI advice on showing to the user that the thank was sent, without obstructing the UI? screenshot |
I think |
|
IMO a toast would make better sense here than snackbar since it doesn't block the UI. |
|
@nicolas-raoul, what i have to implement snackbar with length_short or toast According to me, toast will be better But @nicolas-raoul, please update |
|
Another vote for toast here. :) |
|
OK, let's go with a short toast :-) |
|
@nicolas-raoul, changes the snackbar to short lenght toast |
4D17Y4
left a comment
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.
Looks good to me otherwise.
| import android.app.NotificationManager; | ||
| import android.content.Context; | ||
|
|
||
| import android.view.View; |
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.
These Imports are not needed anymore.
|
|
||
| showNotification(title, message); | ||
|
|
||
| ViewUtil.showShortToast(context,message); |
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 statement was not covered in tests.
Add a test for this line ?
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.
@4D17Y4, how can i cover the code inside of the Observable.defer ?
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.
I believe it should be possible, can u look at the present instances in the codebase if there are any ?
I think we have similar code but not sure if they are covered by tests. Let me know in any case.
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.
@4D17Y4, Sorry but I tried to find on internet and in the codebase also but not able to figure it out
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.
@madhurgupta10, can you please help in this ?
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.
I don't have access to my computer for a few days, maybe you can look at some samples in the codebase or maybe @devarsh-mavani-19 or @Ayan-10 can help you if they faced similar issues before.
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.
I don't have access to my computer for a few days, maybe you can look at some samples in the codebase or maybe @devarsh-mavani-19 or @Ayan-10 can help you if they faced similar issues before.
I told him solution over call a few hours ago. As we were from same college previously and we are in touch with each other.
The way i handled it is by putting code of defer method in a separate function and writing tests for that function. i have implemented it previously in 1 of my PRs will update if i find it. Thanks
|
@4D17Y4 , changes are done |
4D17Y4
left a comment
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.
Looks good otherwise, nice work.
|
|
||
| showNotification(title, message); | ||
| @SuppressLint("StringFormatInvalid") | ||
| private void displayToast(final Context context, final boolean result){ |
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.
displayToast is too generic. I would suggest displayThanksToast as this function is specific to the use case.
Also add some documentation to this function.
|
@4D17Y4, please review this and sorry for the delay i was working on another project. |
|
@4D17Y4, I was trying to run a test but it gives me the invalid res directory name error. |
|
This could be related to #1059 |
neslihanturan
left a comment
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.
Looks correct to me, thanks @arinmodi :) Just waiting tests to be done to merge
Fixes #4906
What changes did you make and why?
Replaced notification with snackbar
Tests performed
Tested build variant on ASUS_X00TD with API level 28
Tested {build variant, e.g. ProdDebug} on {name of device or emulator} with API level {API level}.