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

Snackbar is hidden behind RecylerView if there are enough items to allow to for scrolling #109

Open
perpetuatingcuriosity opened this issue Apr 15, 2015 · 6 comments

Comments

@perpetuatingcuriosity
Copy link

I’m using the snackbar to notify when an item has been deleted from the recyclerview list. I’m using: https://github.com/krossovochkin/Android-SwipeToDismiss-RecyclerView

My snackbar displays fine if there are too few items for the recyclerview to scroll, but once the list is surpasses the height of the screen, the snackbar is hidden behind the recyclerview.

In the image, I’ve just started swiping at the bottom of the screen, and I can see the snackbar appear.

screenshot_2015-04-15-17-20-53

@perpetuatingcuriosity
Copy link
Author

This is in 5.0.

@fahimk
Copy link
Contributor

fahimk commented Apr 19, 2015

Can you post the code you are using to display the snackbar?

@jonathan-caryl
Copy link

I've got this issue in our application too, and after much experimentation I got a test app that shows the problem: https://github.com/jonathan-caryl/SnackbarIssue109.

It looks like it's happening when the android.support.v4.widget.DrawerLayout is given an elevation, which means it's getting drawn over the Snackbar.

@jonathan-caryl
Copy link

It's worth noting that the problem doesn't show up when you run on a pre-Lollipop version of Android, where Views have no elevation.

@jonathan-caryl
Copy link

I've made a PR with a fix in, I hope it's suitable.

@keyur2111
Copy link

Solution (Which Worked for me):

<android.support.design.widget.CoordinatorLayout
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:id="@+id/coordinatorLayout">

    <android.support.v7.widget.RecyclerView
        android:id="@+id/myRecyclerView"
        android:background="@android:color/transparent"
        android:layout_width="match_parent"
        android:layout_height="match_parent"/>

</android.support.design.widget.CoordinatorLayout>

ADD 'RecyclerView' INSIDE CoordinatorLayout AND USE THAT 'CoordinatorLayout' AS VIEWING YOUR SNACKBAR - PROBLEM SOLVED. :)

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

No branches or pull requests

4 participants