use of com.github.florent37.viewanimator.ViewAnimator in project ViewAnimator by florent37.
the class MainActivity method animateParallel.
protected void animateParallel() {
final ViewAnimator viewAnimator = ViewAnimator.animate(mountain, image).dp().translationY(-1000, 0).alpha(0, 1).singleInterpolator(new OvershootInterpolator()).andAnimate(percent).scale(0, 1).andAnimate(text).textColor(Color.BLACK, Color.WHITE).backgroundColor(Color.WHITE, Color.BLACK).waitForHeight().singleInterpolator(new AccelerateDecelerateInterpolator()).duration(2000).thenAnimate(percent).custom(new AnimationListener.Update<TextView>() {
@Override
public void update(TextView view, float value) {
view.setText(String.format(Locale.US, "%.02f%%", value));
}
}, 0, 1).andAnimate(image).rotation(0, 360).duration(5000).start();
new Handler(Looper.getMainLooper()).postDelayed(new Runnable() {
@Override
public void run() {
viewAnimator.cancel();
}
}, 3000);
}
use of com.github.florent37.viewanimator.ViewAnimator in project ViewAnimator by florent37.
the class ViewAnimatorMainActivity method animateParallel.
protected void animateParallel() {
final ViewAnimator viewAnimator = ViewAnimator.animate(mountain, image).dp().translationY(-1000, 0).alpha(0, 1).singleInterpolator(new OvershootInterpolator()).andAnimate(percent).scale(0, 1).andAnimate(text).textColor(Color.BLACK, Color.WHITE).backgroundColor(Color.WHITE, Color.BLACK).waitForHeight().singleInterpolator(new AccelerateDecelerateInterpolator()).duration(2000).thenAnimate(percent).custom(new AnimationListener.Update<TextView>() {
@Override
public void update(TextView view, float value) {
view.setText(String.format(Locale.US, "%.02f%%", value));
}
}, 0, 1).andAnimate(image).rotation(0, 360).duration(5000).start();
new Handler(Looper.getMainLooper()).postDelayed(new Runnable() {
@Override
public void run() {
viewAnimator.cancel();
}
}, 3000);
}
Aggregations