安卓轻量的粒子效果系统库

安卓轻量的粒子效果系统库_第1张图片
ezgif.com-video-to-gif (1).gif

https://github.com/plattysoft/Leonids

使用简单:

初始化:


practiceView = new View(this);
RelativeLayout.LayoutParams lp = new RelativeLayout.LayoutParams(
RelativeLayout.LayoutParams.MATCH_PARENT, RelativeLayout.LayoutParams.MATCH_PARENT);
lp.topMargin = 200;
addContentView(practiceView, lp);

调用显示:

void playPracticle(){
ParticleSystem particleSystem = new ParticleSystem(this, 300, R.mipmap.ic_launcher, 1000)
.setSpeedRange(0.06f, 0.6f)
.setScaleRange(0.125f, 0.5f)
.setRotationSpeedRange(0.1f, 0.8f)
.setFadeOut(800, new android.view.animation.LinearInterpolator())
.setAcceleration(0.001f, 90);

particleSystem.emitWithGravity(this.practiceView, Gravity.TOP | Gravity.CENTER_HORIZONTAL, 300, 1000);//.oneShot(wv.practiceView, 100);

}

你可能感兴趣的:(安卓轻量的粒子效果系统库)