為任意view添加類似于推ter的動畫:SmallBang

碼頭工人 8年前發布 | 8K 次閱讀 SmallBang Android開發 移動開發

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.baiduhome.net/lib/view/home/1451397831464

 本文由用戶 碼頭工人 自行上傳分享,僅供網友學習交流。所有權歸原作者,若您的權利被侵害,請聯系管理員。
 轉載本站原創文章,請注明出處,并保留原始鏈接、圖片水印。
 本站是一個以用戶分享為主的開源技術平臺,歡迎各類分享!