FlipCards
项目地址:
zhangke3016/FlipCards
简介:A 3D Flip Card for Android
标签:
A 3D Flip Card for Android
创意来自Dribbble
Preview
Usage
animation = new FlipCardAnimation(0, degree, width, height);
animation.setInterpolator(new AnticipateOvershootInterpolator());
animation.setDuration(3000);
animation.setFillAfter(false);
animation.setRepeatCount(-1);//设置无限循环
animation.setAnimationListener(new Animation.AnimationListener() {
@Override
public void onAnimationStart(Animation animation) {
}
@Override
public void onAnimationEnd(Animation animation) {
}
@Override
public void onAnimationRepeat(Animation animation) {
((FlipCardAnimation)animation).setCanContentChange();//如果设置循环,务必在这里添加这行代码
}
});
animation.setOnContentChangeListener(new FlipCardAnimation.OnContentChangeListener() {
@Override
public void contentChange() {
if (iv_pro == null) {
return;
}
iv_pro.setBackgroundResource(DRAWABLE[num]);
tv_item.setText("¥" + new Random().nextInt(500));
tv_price_item.setText("Discount");
}
});
llyt_item.startAnimation(animation);