为任意view添加类似于推ter的动画:SmallBang

admin 8年前

SmallBang

推ter like animation for any view :heartbeat:

for ImageView

ImageView

for Button

for TextView

TextView

for any?...

DEMO

demo

Usage

0. Add the following to your build.gradle file.

dependencies {      compile 'hanks.xyz:smallbang-library:0.1.2' }

1. init SmallBang

mSmallBang = SmallBang.attach2Window(this);

2. animate to view

mSmallBang.bang(view);

or

mSmallBang.bang(view,new SmallBangListener() { @Override public void onAnimationStart() {      } @Override public void onAnimationEnd() {          toast("button +1");      }  });

or

mSmallBang.bang(view,50,new SmallBangListener() { @Override public void onAnimationStart() {      } @Override public void onAnimationEnd() {          toast("text+1");      }  });

other method

/**  * set different colors for dots, the length should be   2 at least, colors[0] and colors[1] are Big Circle startColor   and endColor;  *  * @param newColors  *  / public void setColors(int[] newColors) /**  * set small dot number  * @param dotNumber  *  / public void setDotNumber(int dotNumber);

官方网站:http://www.open-open.com/lib/view/home/1451397831464