public static void effect(int duration, final Effect effect) {
if (!effect.init()) {
return;
}
new Animator(duration).start(new Animator.Callback() {
public void update(double progress) {
progress = effect.getTransition().translate(progress);
effect.update(progress);
}