android_guides icon indicating copy to clipboard operation
android_guides copied to clipboard

How to add click animation to ImageButton (on click)?

Open AucT opened this issue 8 years ago • 1 comments

https://guides.codepath.com/android/Styling-UI-Screens-FAQ

great article on imageButton. But I aslo need to know (and hopefully other people) how to add click animation to imageButton? for example like on youtube app when clicking thumb up comment there is animation (default click button beahviour)

AucT avatar Oct 22 '17 09:10 AucT

Hope these articles help you out -

  • Setting state for ImageButton https://stackoverflow.com/questions/12825613/imagebutton-doesnt-highlight-on-click-with-transparent-background
  • Darken on Press effect (using Button) https://stackoverflow.com/questions/7175873/click-effect-on-button-in-android
  • Ripple effect (using Button) https://stackoverflow.com/questions/40008609/add-ripple-effect-to-my-button-with-button-background-color

The last two links contain xml files with effects that are compatible with ImageButton as well.

saraansh avatar Nov 18 '17 23:11 saraansh