Listener for ListViews and RecyclerViews. Don't dismiss while swiping
You can attach the Snackbar
to a AbsListView (ListView, GridView) or a RecyclerView.
Snackbar.with(getApplicationContext()) // context
.type(Snackbar.SnackbarType.MULTI_LINE) // Set is as a multi-line snackbar
.text("This is a multi-line snackbar. Keep in mind that snackbars are " +
"meant for VERY short messages") // text to be displayed
.duration(Snackbar.SnackbarDuration.LENGTH_LONG)
.animation(false) // don't animate it
.attachToAbsListView(listView) // Attach to ListView - attachToRecyclerView() is for RecyclerViews
.show(this); // where it is displayed
A Snackbar
won't be dismissed while it is being swiped