Anim Button – Inspired by Whatsapp

In some of the popular chat applications like whatsapp or hangouts, there is a button which can be transformed into a record button and also when you enter some text it will transform into a send button.

AnimButton is a custom ImageButton which is imitating the whatsapp’s send button behavior. Basically, it will change the image source when you enter some text on the edittext and it will go back when you clear the edittext

In this post I will try to mimic this behavior in my AnimButton project. Also, the full source code of the project can be found on the Github.

I want to introduce the class to you:

To use the anim button in your layout you simple set the custom attributes of first and second drawables like so:

            app:second="@drawable/ic_send" />


And here you can see the AnimButton in action:

Anim button for android
Anim button simple usage