Home > Web Front-end > HTML Tutorial > Animation动作完成后停顿一段时间再次重复_html/css_WEB-ITnose

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

WBOY
Release: 2016-06-21 08:52:13
Original
2103 people have browsed it

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);    }
Copy after login


source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template