You are here
Home > Android > Adding Animations to Controls or Layouts in Android

Adding Animations to Controls or Layouts in Android

Hello Friends, Today we are going to learn adding animations to controls or Layouts in Android. Recently I was working on an app in which I was required to add animation on a control’s visiblility “gone” and “visible”. So I used alpha method to achieve fade in and fade out effect . But here I have demonstrated several other methods also i.e translationX, translationY, scaleX, rotation, etc. We can also attach listeners on animation to perform some specific task just as I have attached to combine two animations. We can also perfom these animations on layouts also i.e LinearLayout, TableLayout, etc same way. So, now I thought to share a test AndroidStudio Project to help myself in future developments. 😉

So, here is the code

MainActivity.java

activity_main.xml

Video

AndroidStudio Project Download

Reference

https://stackoverflow.com/questions/22454839/android-adding-simple-animations-while-setvisibilityview-gone

Thanks for Stoping by
If you find this helpful then please share

Rajesh Kumar Sahanee
I am a passionate Java Developer and I like Computer Programming. I love to do some interesting experiments and listening music in my free time.
https://www.zatackcoder.com

Comments

zatackcoder
Top