- 
                Notifications
    
You must be signed in to change notification settings  - Fork 914
 
fix: Replace snackbars with snackbarshandler #2855
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
| 
           @adityastic please review.  | 
    
| 
           Why?  | 
    
| 
           We have a separate class which we use for handling snackbars across the app, SnackbarHandler. Some of the snackbars being used currently were just made using snackbar.make, instead of the Handler class for snackbars. So I converted those to SnackbarHandler.  | 
    
| 
           What advantage does SnackbarHandler have?  | 
    
| 
           @iamareebjamal it was created to have a common class to create all kinds of snackbars except those with actions. We use it to create snackbars with different bottom margins. So all these functions we created in this common class,   | 
    
| .show(); | ||
| getString(R.string.Cloudrail_License_key), | ||
| Snackbar.LENGTH_SHORT); | ||
| snackbar.show(); | 
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 ridiculous. Why calling show 2 times. It should only be called once
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.
The earlier .show is SnackBarHandler.show(). This creates a snackbar and returns it. Then to show it, we use the second .show().
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.
Then it should not be called show. It should be create or make
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.
Ok. I'll do that and update the pr.
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.
Done.
| public void showError() { | ||
| Snackbar snackbar = SnackBarHandler.show(coordinatorLayout, getString(no_account_signed_in)); | ||
| Snackbar snackbar = SnackBarHandler.create(coordinatorLayout, getString(no_account_signed_in)); | ||
| snackbar.show(); | 
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.
No need to save in a variable. Directly call show
| 
           @iamareebjamal please merge.  | 
    
Fixed #2593
Changes: Replace snackbars with snackbarshandler