Skip to content
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

Use single listener for many snackbars/actions. #22

Open
pawelantczak opened this issue Aug 14, 2019 · 1 comment
Open

Use single listener for many snackbars/actions. #22

pawelantczak opened this issue Aug 14, 2019 · 1 comment
Labels

Comments

@pawelantczak
Copy link

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?

@matecode
Copy link
Owner

matecode commented Aug 15, 2019

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants