Langsung ke konten utama

Postingan

Menampilkan postingan dari Januari, 2017

How to Customize Snack Bar in Android

Every Android Developer knows about the Snackbar , which is an important component introduced in Material Design. It is similar to Toast used for android Development. But the Snackbar had provides action callback to perform action like Click-listeners  in Button. In this article, we are going to learn How to Customize the Snackbar. Summary We are going learn, Implementation of Default Snackbar Implementation of Snackbar with action callback Snackbar with custom gravity for message text Snackbar with custom color Snackbar with custom text color for message and action. Snackbar with custom typeface for message text and action text. Implementation of Top Snackbar Implementation of Default Snackbar Below is the syntax of a simple Snackbar. The make function accepts three parameters. View, display message and duration of the message to be displayed. Snackbar.make(v, "Normal Snackbar", Snackbar.LENGTH_LONG).show(); Implementation of Snackbar with action callback Below is the syntax