Created
December 29, 2017 06:56
-
-
Save sreelallalu/ac718ee3bcf5e2b85d813095f7b05616 to your computer and use it in GitHub Desktop.
ObjectAnimation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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