針對任意視圖的推ter like動畫:SmallBang

jopen 8年前發布 | 11K 次閱讀 Android開發 移動開發

針對任意視圖的推ter like動畫。

使用說明:

0.  在 build.mSmallBang.bang(view); 文件中添加如下:

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

1. 初始化 SmallBang

mSmallBang = SmallBang.attach2Window(this);

2. 向view添加動畫

mSmallBang.bang(view);

或者

mSmallBang.bang(view,new SmallBangListener() {
    @Override
    public void onAnimationStart() {
    }

    @Override
    public void onAnimationEnd() {
        toast("button +1");
    }
});

或者

mSmallBang.bang(view,50,new SmallBangListener() {
    @Override
    public void onAnimationStart() {
    }

    @Override
    public void onAnimationEnd() {
        toast("text+1");
    }
});


其它方法

/**
  * 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);


項目地址: https://github.com/hanks-zyh/SmallBang

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