Android 柱形WaveView
介绍:
一个实现了水波纹动态效果的自定义view,能够改变水的高度,此特性使其可以作为呈现加载效果的progressbar ,可自定义背景色以及进度等
源码项目: https://github.com/john990/WaveView
运行效果:
使用说明:
1
2
3
4
5
6
7
8
9
|
<com.john.waveview.WaveView
xmlns:wave="http://schemas.android.com/apk/res-auto"
android:id=
"@+id/wave_view"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
android:background=
"@color/holo_purple"
wave:above_wave_color=
"@android:color/white"
wave:blow_wave_color=
"@android:color/white"
wave:progress=
"60"
/>
|
也可以直接使用默认的外观,默认进度为80%
1
2
3
4
5
6
|
<com.john.waveview.WaveView
android:id=
"@+id/wave_view"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
android:background=
"@color/holo_purple"
/>
|
java:
1
2
3
4
5
6
|
waveView= (WaveView) findViewById(R.id.wave_view);
waveView.setProgress(int progress);
|
waveView.setProgress(int progress);