FlipCards

FlipCards

项目地址: zhangke3016/FlipCards
简介:A 3D Flip Card for Android
更多: 作者    提 Bug   
标签:

A 3D Flip Card for Android

创意来自Dribbble

Preview

FlipCards


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);
C语言有一叠卡片,卡片号依次为1到n,并且所有卡片的正面朝上。从卡片号2开始,把凡是偶数的卡片都翻成正面朝下。再从3号卡片开始,把凡是卡片号为3的倍数的卡片都翻一面(即把正面朝上的翻成正面朝下,把正面朝下的翻成正面朝上)。下一步从4号卡片开始,把凡是卡片号为4的倍数的卡片都翻转一次,依次类推。问:最后哪些卡片朝上。 【输入形式】 输入一个整数n,表示卡片的总数,6<=n<450 【输出形式】 用空格分开的多个整数。 【样例输入】 23 【样例输出】 1 4 9 16 #include  <stdio.h> void  upDown(int  *p,int  n); int  main() {        int  a[450],x,n;         scanf("%d",&n);         for(x=1;x<=n;x++)                 a[x]=1;         upDown(a,n);                 for(x=1;x<=n;x++)                 if(a[x]==1)  printf("%d  ",x);         } void  upDown(int  *p,int  total)   {        int  x,y;         x=2;         do         {                                          while(y<=total)                 {                                                          y+=x;                 }                 x++;         }while(x<=total);         }
05-24
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值