@@ -0,0 +1,2014 @@
+package github.yaa110.memento.inner;%0A%0Aimport android.content.Context;%0Aimport android.view.View;%0Aimport android.view.animation.Animation;%0Aimport android.view.animation.AnimationUtils;%0A%0A@SuppressWarnings(%22unused%22)%0Apublic class Animator %7B%0A%0A%09private Context context;%0A%09private View view;%0A%09private boolean clear = true;%0A%09private long delay = 0;%0A%09private int start_visiblity = View.VISIBLE;%0A%09private int end_visiblity = View.VISIBLE;%0A%09private AnimatorListener listener = null;%0A%0A%09private Animator(Context context) %7B%0A%09%09this.context = context;%0A%09%7D%0A%0A%09public static Animator create(Context context) %7B%0A%09%09return new Animator(context);%0A%09%7D%0A%0A%09public %3CT extends View%3E Animator on(T view) %7B%0A%09%09this.view = view;%0A%09%09return this;%0A%09%7D%0A%0A%09public Animator setDelay(long delay) %7B%0A%09%09this.delay = delay;%0A%09%09return this;%0A%09%7D%0A%0A%09public Animator setClear(boolean clear) %7B%0A%09%09this.clear = clear;%0A%09%09return this;%0A%09%7D%0A%0A%09public Animator setStartVisibility(int visiblity) %7B%0A%09%09this.start_visiblity = visiblity;%0A%09%09return this;%0A%09%7D%0A%0A%09public Animator setEndVisibility(int visiblity) %7B%0A%09%09this.end_visiblity = visiblity;%0A%09%09return this;%0A%09%7D%0A%0A%09public Animator setListener(AnimatorListener listener) %7B%0A%09%09this.listener = listener;%0A%09%09return this;%0A%09%7D%0A%0A%09public void animate(int anim_id) %7B%0A%09%09Animation animation = AnimationUtils.loadAnimation(context, anim_id);%0A%09%09if (delay %3E 0) %7B%0A%09%09%09animation.setStartOffset(delay);%0A%09%09%7D%0A%09%09animation.setAnimationListener(new Animation.AnimationListener() %7B%0A%09%09%09boolean end_status = false;%0A%0A%09%09%09@Override%0A%09%09%09public void onAnimationStart(Animation animation) %7B%7D%0A%0A%09%09%09@Override%0A%09%09%09public void onAnimationEnd(Animation animation) %7B%0A%09%09%09%09if (!end_status) %7B%0A%09%09%09%09%09end_status = true;%0A%09%09%09%09%09if (clear) view.clearAnimation();%0A%09%09%09%09%09view.setVisibility(end_visiblity);%0A%09%09%09%09%09if (listener != null) %7B%0A%09%09%09%09%09%09listener.onAnimate();%0A%09%09%09%09%09%7D%0A%09%09%09%09%7D%0A%09%09%09%7D%0A%0A%09%09%09@Override%0A%09%09%09public void onAnimationRepeat(Animation animation) %7B%7D%0A%09%09%7D);%0A%09%09view.setVisibility(start_visiblity);%0A%09%09view.startAnimation(animation);%0A%09%7D%0A%0A%09public interface AnimatorListener %7B%0A%09%09void onAnimate();%0A%09%7D%0A%0A%7D%0A

Add Animator