Skip to content

Instantly share code, notes, and snippets.

@rafaelje
Created July 26, 2017 19:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rafaelje/2632ef9ca2e103498cbd06ad777fd033 to your computer and use it in GitHub Desktop.
Save rafaelje/2632ef9ca2e103498cbd06ad777fd033 to your computer and use it in GitHub Desktop.
Snack on android
private void snack(View view, Context context, String message, String action) {
Snackbar.make(view, message, Snackbar.LENGTH_LONG)
.setActionTextColor(context.getResources().getColor(R.color.snackbar_action))
.show();
}
private void snack(View view, Context context, String message, String action, View.OnClickListener callback) {
Snackbar.make(view, message, Snackbar.LENGTH_LONG)
.setActionTextColor(context.getResources().getColor(R.color.snackbar_action))
.setAction(action, callback)
.show();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment