https://github.com/hehonghui/ripplelayout
RippleLayout library
https://github.com/hehonghui/ripplelayout
Last synced: over 1 year ago
JSON representation
RippleLayout library
- Host: GitHub
- URL: https://github.com/hehonghui/ripplelayout
- Owner: hehonghui
- License: mit
- Created: 2015-01-09T02:37:00.000Z (over 11 years ago)
- Default Branch: master
- Last Pushed: 2015-01-10T07:38:01.000Z (over 11 years ago)
- Last Synced: 2025-03-21T11:50:35.169Z (over 1 year ago)
- Language: Java
- Size: 328 KB
- Stars: 50
- Watchers: 8
- Forks: 25
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
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();
}
}
});
}
```