【开源】android-ripple-background
android-ripple-background
- https://github.com/skyfishjy/android-ripple-background
介绍:
能产生波浪效果的背景图片控件,可以自定义颜色,波浪扩展的速度,波浪的圈数。运行效果:


使用说明:
在xml添加RippleBackground ,并为RippleBackground放置你想要的内容,比如imageview:
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
|
<com.skyfishjy.library.RippleBackground android:layout_width="match_parent" android:layout_height="match_parent" android:id="@+id/content" app:rb_color="#0099CC" app:rb_radius="32dp" app:rb_rippleAmount="4" app:rb_duration="3000" app:rb_scale="6"> <ImageView android:layout_width="64dp" android:layout_height="64dp" android:layout_centerInParent="true" android:id="@+id/centerImage" android:src="@drawable/demoImage"/></com.skyfishjy.library.RippleBackground> |
开始播放动画:
|
1
2
3
4
5
6
7
8
|
final RippleBackground rippleBackground=(RippleBackground)findViewById(R.id.content); ImageView imageView=(ImageView)findViewById(R.id.centerImage); imageView.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { rippleBackground.startRippleAnimation(); } }); |
停止动画:
|
1
|
rippleBackground.stopRippleAnimation(); |
posted on 2015-03-26 13:49 wasdchenhao 阅读(757) 评论(0) 收藏 举报
浙公网安备 33010602011771号