I've downloaded the sample project on this blog android button animation. I tried to modify the code and change the position of the button, but when I change position also with animation, it's like the screen is divided in section and every section have one animation. How can I apply one of any animation at one single button that I can move in every part of the screen?
1 Answer
It seems that you are not very familiar with Android, because the example that you have posted is very self-explicative.
As you can see the main layout is composed by a LinearLayout where are inserted four different button. The item inside a LinearLayout are displayed one after the other, so the only position specified in that layout is the option
   android:layout_margin="10dp"
If you need to specify different position (absolute position on the screen) I suggest you to use a RelativeLayout and set marginTop and MarginLeft option for every button inside your XML.
To apply an animation to a button you have simply to reply the code posted in your example:
   btnTranslate.setOnClickListener(new Button.OnClickListener(){
   @Override
   public void onClick(View arg0) {
          arg0.startAnimation(animTranslate);
   }});
After the definition of the button and the animation;)