public class ITest {
void test(){
setAllListenr(new Animator.AnimatorListener() {
@Override
public void onAnimationStart(Animator animator) {
}
@Override
public void onAnimationEnd(Animator animator) {
}
@Override
public void onAnimationCancel(Animator animator) {
}
@Override
public void onAnimationRepeat(Animator animator) {
}
});
// 往往只需要end回调时,避免了重写其他多余的方法
setFixListener(new FixAnimator(){
@Override
public void onAnimationEnd(Animator animator) {
super.onAnimationEnd(animator);
}
});
}
public void setAllListenr(Animator.AnimatorListener listenr) {
}
public void setFixListener(Animator.AnimatorListener listenr) {
}
class FixAnimator implements Animator.AnimatorListener{
@Override
public void onAnimationStart(Animator animator) {
}
@Override
public void onAnimationEnd(Animator animator) {
}
@Override
public void onAnimationCancel(Animator animator) {
}
@Override
public void onAnimationRepeat(Animator animator) {
}
}
}