Advertisement
Guest User

Untitled

a guest
Apr 23rd, 2014
41
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.88 KB | None | 0 0
  1. public class MainActivity extends ActionBarActivity implements
  2. Animation.AnimationListener{
  3.  
  4. ImageView ball;
  5. Button moveb1;
  6.  
  7. Animation move;
  8.  
  9. @Override
  10. protected void onCreate(Bundle savedInstanceState) {
  11. super.onCreate(savedInstanceState);
  12. setContentView(R.layout.activity_main);
  13.  
  14. ball = (ImageView) findViewById(R.id.ball);
  15. moveb1 = (Button) findViewById(R.id.move1);
  16.  
  17. move = AnimationUtils.loadAnimation(getApplicationContext(),
  18. R.animator.move);
  19.  
  20. move.setAnimationListener(this);
  21. }
  22. }
  23.  
  24. <set xmlns:android="http://schemas.android.com/apk/res/android"
  25. android:ordering="together">
  26. <objectAnimator
  27. android:propertyName="x"
  28. android:duration="500"
  29. android:valueTo="400"
  30. android:valueType="intType"/>
  31. <objectAnimator
  32. android:propertyName="y"
  33. android:duration="500"
  34. android:valueTo="300"
  35. android:valueType="intType"/>
  36. </set>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement