-
Notifications
You must be signed in to change notification settings - Fork 107
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'origin/master'
- Loading branch information
Showing
2 changed files
with
87 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,75 @@ | ||
# WaveLineView | ||
a beatiful wave line animation | ||
## 一款内存友好的录音漂亮的波浪动画 | ||
|
||
# 效果图(实际效果更好) | ||
|
||
![image](https://github.com/Jay-Goo/WaveLineView/blob/master/pictures/%E6%95%88%E6%9E%9C.gif) | ||
|
||
---------- | ||
|
||
# Usage | ||
## Step1 | ||
``` | ||
allprojects { | ||
repositories { | ||
... | ||
maven { url 'https://jitpack.io' } | ||
} | ||
} | ||
dependencies { | ||
compile 'com.github.Jay-Goo:WaveLineView:v1.0.2' | ||
} | ||
``` | ||
## Step2 | ||
|
||
``` | ||
<jaygoo.widget.wlv.WaveLineView | ||
android:id="@+id/waveLineView" | ||
android:layout_width="match_parent" | ||
android:layout_height="120dp" | ||
app:wlvBackgroundColor="@android:color/white" | ||
app:wlvMoveSpeed="290" | ||
/> | ||
``` | ||
## Step3 | ||
|
||
``` | ||
waveLineView.startAnim(); | ||
waveLineView.stopAnim(); | ||
``` | ||
|
||
``` | ||
@Override | ||
protected void onResume() { | ||
super.onResume(); | ||
waveLineView.onResume(); | ||
} | ||
@Override | ||
protected void onPause() { | ||
super.onPause(); | ||
waveLineView.onPause(); | ||
} | ||
@Override | ||
protected void onDestroy() { | ||
super.onDestroy(); | ||
waveLineView.release(); | ||
} | ||
``` | ||
|
||
---------- | ||
# Attributes | ||
attr | format | description | ||
-------- | ---|--- | ||
backgroundColor|color|背景色 | ||
wlvLineColor|color|波浪线的颜色 | ||
wlvThickLineWidth|dimension|中间粗波浪曲线的宽度 | ||
wlvFineLineWidth|dimension|三条细波浪曲线的宽度 | ||
wlvMoveSpeed|float|波浪线移动的速度,默认值为290F,方向从左向右,你可以使用负数改变移动方向 | ||
wlvSamplingSize|integer|采样率,动画效果越大越精细,默认64 | ||
wlvSensibility|integer|灵敏度,范围[1,10],越大越灵敏,默认值为5 | ||
|
||
## [原理讲解传送门](https://github.com/Jay-Goo/WaveLineView/blob/master/blog.md) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters