Providing lightweight, quick feedback on operations is a great time to use Snackbar. The Snackbar display asks on the screen and contains text that supports optional single-action. They automatically time out after a given time and leave the screen in an animated form. In addition, users can swipe to disappear before timing out.
View Snackbar Effect Click (Note FQ when not open)
With the ability to interact with it by swiping or moving, Snackbar obviously has the ability to be more powerful than a toast, and a lightweight feedback mechanism. However, you will find that the API is actually very familiar to you:
1 Snackbar2 . Make (Parentlayout, R.string.snackbar_text, Snackbar.length_long) 3 . Setaction ( R.string.snackbar_action, Myonclicklistener) 4 . Show ();//Don ' t forget to show!
You will notice the use of the first parameter view of the Make () method-snackbar will try to find the appropriate parent view of your own view to ensure that it appears at the bottom.
Material Design (vi)--snackbar