Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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?

like image 939
Tim Trueman Avatar asked Sep 02 '14 23:09

Tim Trueman


People also ask

What is a snackbar coding?

Snackbars provide lightweight feedback about an operation. They show a brief message at the bottom of the screen on mobile and lower left on larger devices. Snackbars appear above all other elements on screen and only one can be displayed at a time.

What are Snackbars UI?

Snackbars provide brief feedback about an operation through a message at the bottom of the screen. Snackbars contain a single line of text directly related to the operation performed. They may contain a text action, but no icons. Toasts (Android only) are primarily used for system messaging.

How do you set a snackbar position?

Snackbars should be placed at the bottom of a UI, in front of app content.


2 Answers

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!

like image 162
wmora Avatar answered Oct 18 '22 21:10

wmora


FWIW,

It would appear that there is no Snackbar implementation in the L Developer Preview. I've also implemented a Snackbar library with the intentions of being as close to the material design guidelines as I can. Thanks.

like image 37
MrEngineer13 Avatar answered Oct 18 '22 21:10

MrEngineer13