Snacky icon indicating copy to clipboard operation
Snacky copied to clipboard

Use single listener for many snackbars/actions.

Open pawelantczak opened this issue 4 years ago • 1 comments

Hello. On one fragment I have lots of different snackbars to show. I don't want to have inner callback class for each of actions. How to do that?

pawelantczak avatar Aug 14 '19 20:08 pawelantczak

Just use a reference to your "single listener". Of course, if you want to know what to "action" then, you need refernces to the snackbar view, which is maybe even worse than inner classes. Maybe use lambdas to clean up your code.

matecode avatar Aug 15 '19 12:08 matecode