Photo by Amauri Acosta Montiel on Unsplash

Know your attributes: enter/exitFadeDuration

Sviatoslav Melnychenko
1 min readApr 25, 2019

--

You're creating one more awesome button. Nice guy designer provided you with colors for released and pressed states. A selector is your obvious choice:

And you can enjoy the result:

Hey, want some magic just in two lines? Add these two attributes to the selector:

android:enterFadeDuration="@android:integer/config_shortAnimTime"
android:exitFadeDuration="@android:integer/config_shortAnimTime"

Check it now:

Works with font color as well.

--

--