Giter VIP home page Giter VIP logo

particlesmasher's Introduction

Android 粒子破碎效果,可以使用于任何View。

特色:

  • 六种效果,包含爆炸效果、坠落效果、四个方向的逐渐飘落效果;
  • 链式调用,自定义动画时间、样式、动画幅度等;

效果图:

六种效果演示

用法:

导入

dependencies {
 compile 'com.ifadai:particlesmasher:1.0.1'
}

简单使用:

 ParticleSmasher smasher = new ParticleSmasher(this);
 // 默认为爆炸动画
 smasher.with(view).start();

复杂一点:

smasher.with(view)
        .setStyle(SmashAnimator.STYLE_DROP)    // 设置动画样式
        .setDuration(1500)                     // 设置动画时间
        .setStartDelay(300)                    // 设置动画前延时
        .setHorizontalMultiple(2)              // 设置横向运动幅度,默认为3
        .setVerticalMultiple(2)                // 设置竖向运动幅度,默认为4
       .addAnimatorListener(new SmashAnimator.OnAnimatorListener() {
                            @Override
                            public void onAnimatorStart() {
                                super.onAnimatorStart();
                                // 回调,动画开始
                            }

                            @Override
                            public void onAnimatorEnd() {
                                super.onAnimatorEnd();
                                // 回调,动画结束
                            }
                        })
        .start();    

让View重新显示:

smasher.reShowView(view);

代码解析:

Android粒子破碎效果(2)——实现多种破碎效果之ParticleSmasher

particlesmasher's People

Contributors

ifadai avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.