Skip to content

Instantly share code, notes, and snippets.

@sreelallalu
Created December 29, 2017 06:56
Show Gist options
  • Save sreelallalu/ac718ee3bcf5e2b85d813095f7b05616 to your computer and use it in GitHub Desktop.
Save sreelallalu/ac718ee3bcf5e2b85d813095f7b05616 to your computer and use it in GitHub Desktop.
ObjectAnimation
public void Animate(View view)
{
Display display = getWindowManager().getDefaultDisplay();
Point point=new Point();
display.getSize(point);
final int width = point.y; // screen height
final float halfW = width/2.0f;
//Y orX transactionY or tranX
ObjectAnimator lftToRgt = ObjectAnimator.ofFloat( view,"Y",200,0f )
.setDuration(3200); // to animate left to right
AnimatorSet s = new AnimatorSet();//required to set the sequence
s.setInterpolator(new BounceInterpolator());
s.play( lftToRgt ); // manage sequence
s.start();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment