Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class MainActivity extends ActionBarActivity implements
- Animation.AnimationListener{
- ImageView ball;
- Button moveb1;
- Animation move;
- @Override
- protected void onCreate(Bundle savedInstanceState) {
- super.onCreate(savedInstanceState);
- setContentView(R.layout.activity_main);
- ball = (ImageView) findViewById(R.id.ball);
- moveb1 = (Button) findViewById(R.id.move1);
- move = AnimationUtils.loadAnimation(getApplicationContext(),
- R.animator.move);
- move.setAnimationListener(this);
- }
- }
- <set xmlns:android="http://schemas.android.com/apk/res/android"
- android:ordering="together">
- <objectAnimator
- android:propertyName="x"
- android:duration="500"
- android:valueTo="400"
- android:valueType="intType"/>
- <objectAnimator
- android:propertyName="y"
- android:duration="500"
- android:valueTo="300"
- android:valueType="intType"/>
- </set>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement