首页  >  文章  >  web前端  >  Animation动作完成后停顿一段时间再次重复_html/css_WEB-ITnose

Animation动作完成后停顿一段时间再次重复_html/css_WEB-ITnose

WBOY
WBOY原创
2016-06-21 08:52:132076浏览

animation 周期动作,且中途停顿:

 public void alwaysWave() {        AnimationSet as = new AnimationSet(true);        ScaleAnimation sa = new ScaleAnimation(1f, ANIMATION_SCALE_MULTIPLE, 1f, ANIMATION_SCALE_MULTIPLE, ScaleAnimation.RELATIVE_TO_SELF,                0.5f, ScaleAnimation.RELATIVE_TO_SELF, 0.5f);        sa.setDuration(ANIMATION_EACH_OFFSET * 3);//        sa.setRepeatCount(Animation.INFINITE);// 设置循环        sa.setRepeatCount(1);// 设置循环        sa.setAnimationListener(new Animation.AnimationListener() {            @Override            public void onAnimationStart(Animation animation) {                Logger.i("动画开始");            }            @Override            public void onAnimationEnd(Animation animation) {                Logger.i("动画结束");                postDelayed(new Runnable() {                    @Override                    public void run() {                        alwaysWave();                    }                }, 800);            }            @Override            public void onAnimationRepeat(Animation animation) {                Logger.i("动画重复");            }        });        AlphaAnimation aniAlp = new AlphaAnimation(0.8f, 0.1f);//        aniAlp.setRepeatCount(Animation.INFINITE);// 设置循环        aniAlp.setRepeatCount(1);// 设置循环        as.setDuration(ANIMATION_EACH_OFFSET * 3);        as.addAnimation(sa);        as.addAnimation(aniAlp);        bldot.startAnimation(as);    }


声明:
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系admin@php.cn