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?
Using design library we can implement for all the versions of Android 2.1 onward.
Here is the working example code http://www.feelzdroid.com/2015/06/snackbar-android-example-using-design-support-library.html.
If you need any help, drop comment.
Snackbar is effectively just a Crouton with some margins. Crouton in its current form only supports adding to start (0th item) of a ViewGroup, however you can find the very "strayan" enhancement to Crouton, DownUnderMode, at my github. Just beware that the official Crouton library and DownUnderMode version are a little out of sync (which will hopefully be fixed in the year 2058 when the DownUnderMode pull request is accepted).
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!
Here is simple way to implement snackbar in android
Step 1. Add support library 23 and compile your project with
Step 2. Add coordinate layout in your activity file
Step 3. Now add following code in your MainActivity.java to implement snackbar
Hope this will work for you.
For more android tutorial please follow this blog: Trinity Tuts
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.Mabye take a look at this here. http://www.williammora.com/2014/08/snackbar-android-library.html
I am guessing the native version will show up in the sdk eventually. It is a bit odd I agree.