An open API service indexing awesome lists of open source software.

https://github.com/hehonghui/ripplelayout

RippleLayout library
https://github.com/hehonghui/ripplelayout

Last synced: over 1 year ago
JSON representation

RippleLayout library

Awesome Lists containing this project

README

          

# ripplelayout
这是一个类似于支付宝声波支付的波纹效果布局, 使用了NineOldAnimations动画库,使之可以兼容API 11以下的系统。效果如下:

## 使用示例
在布局文件中添加RippleLayout,并且将你的中心视图添加到RippleLayout中,例如 :
```xml



```


这样,图片就在RippleLayout的中心,RippleLayout会为你添加通过rippleNums指定的波形数量.
**注意**,上述布局中引用了xmlns:ripple="http://schemas.android.com/apk/org.simple.ripplelayout",这是RippleLayout的资源路径,修改成你包路径即可路径。
更多详情请参考 : Mr.Simple的博客 .



**代码中启动动画**

```java

ImageView imageview;
RippleLayout layout;

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);

layout = (RippleLayout) findViewById(R.id.ripple_layout);
imageview = (ImageView) findViewById(R.id.centerImage);
imageview.setOnClickListener(new OnClickListener() {

@Override
public void onClick(View v) {
if (layout.isRippleAnimationRunning()) {
layout.stopRippleAnimation();
} else {
layout.startRippleAnimation();
}
}
});
}
```