Search code examples
androidandroid-fragmentsandroid-snackbarsnackbar

How to make snackbar show up at the bottom of a RecycleView?


I have a RecycleView in my fragment, and I need to show a snackbar at the bottom of it. Whenever I pass the RecycleView to the snackbar's view parameter, it just shows the snackbar at the bottom of the fragment (I have stuff below the RecycleView that is getting covered up by the fragment).

This is the code I'm using:

Snackbar.make(mRecyclerView, "New message!", Snackbar.LENGTH_LONG).show();

What should I pass as the first parameter to make the snackbar appear in the correct location?


Solution

  • @DeeV solved my problem: Wrap the RecyclerView inside a CoordinatorLayout.