Drop the Toast and Snackbar, to replace it by ChocoBar

Pradyuman Dixit
AndroidPub
Published in
3 min readJan 4, 2019

As per documentation

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.

Snackbar preview

Toasts provides simple feedback about an operation in a small popup. It only fills the amount of space required for the message and the current activity remains visible and interactive. Toasts automatically disappear after a timeout.

Toast preview

Here is a cool medium post with cool trivia about Snackbars.

They look cool, don’t they?

But, what if you could customise this to be even more stylish and add even more functionalities to improve UX and UI of your android app.

Here is where, the role of ChocoBar comes into play.

ChocoBar

You can easily add this library in your android app, as the whole source code and information to use this library is present on GitHub.

You can know more about the library here.

Adding functionalities, colours, styles and much more options are easily done by this open source android library. I worked on this android library when I myself was under a situation where I needed custom popup messages.

Adding colours and design options made the working of the app very complex due to other features that I was using. This made me think, that making an open source library that does exactly this would greatly help out android developers.

My whole working was based on KISS (keep it stupid simple) and adding more styling options with less amount of code.

This is how the ChocoBars look, when used in an app, and you can customise them even further according to your needs.

Simple ChocoBar
Green ChocoBar

You can even add buttons and add some functionality to the button and make the ChocoBar stay until the user swipes it away, or make it disappear after a timeout.

Red ChocoBar

There is still more! You can have even more customised ChocoBar which has your logo, tagline and text with customised background and many more easy to add and cool looking features.

And the code for this is all set, you just have to fill out your details and simple functionality code that you need to put.

And the result?

Customised ChocoBar

--

--