Is there code for Snackbars in Android L or are we expected to implement them ourselves?

Tim Trueman picture Tim Trueman · Sep 3, 2014 · Viewed 11.8k times · Source

The Material design website mentions a new Toast-like element called a Snackbar: http://www.google.com/design/spec/components/snackbars-and-toasts.html

The Android L preview SDK documentation (sorry can't link since it's only downloadable) doesn't have any mention of Snackbar in the classes list or as a modifier in the Toast class documentation. Am I missing something obvious or should I build my own Snackbar.java?

Answer

wmora picture wmora · Sep 13, 2014

Update 2015-05-29:

Google released a Design Support Library which includes a Snackbar and other Material Design widgets.

The Snackbar lib mentioned in the original answer is now deprecated.

Original answer

I'm sure Google will eventually include it in a future SDK, along with a Floating Action Button that is also missing in the preview SDK.

As @friedrich nietzche pointed out, I implemented a library to include a Snackbar in your project.

https://github.com/nispok/snackbar

Hope it helps!