Skip to content

Commit

Permalink
Merge pull request #63 from nan403/master
Browse files Browse the repository at this point in the history
bugfix #61
  • Loading branch information
CarGuo committed Jun 10, 2021
2 parents 38aa8c5 + c9e98c7 commit 1b1174c
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 14 deletions.
6 changes: 3 additions & 3 deletions OLD_VERSION.md
Original file line number Diff line number Diff line change
Expand Up @@ -114,9 +114,9 @@ audioWave.startView();

```
<declare-styleable name="waveView">
<attr name="waveColor" format="color" />
<attr name="waveOffset" format="dimension" />
<attr name="waveCount" format="dimension" />
<attr name="gsyWwaveColor" format="color" />
<attr name="gsyWaveOffset" format="dimension" />
<attr name="gsyWaveCount" format="dimension" />
</declare-styleable>
audioWave.startView(); //开始绘制
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -129,10 +129,10 @@ public void init(Context context, AttributeSet attrs) {

if (attrs != null) {
TypedArray ta = getContext().obtainStyledAttributes(attrs, R.styleable.waveView);
mOffset = ta.getInt(R.styleable.waveView_waveOffset, dip2px(context, -11));
mWaveColor = ta.getColor(R.styleable.waveView_waveColor, Color.WHITE);
mColorBack = ta.getColor(R.styleable.waveView_texture_bg_waveColor, Color.TRANSPARENT);
mWaveCount = ta.getInt(R.styleable.waveView_waveCount, 2);
mOffset = ta.getInt(R.styleable.waveView_gsyWaveOffset, dip2px(context, -11));
mWaveColor = ta.getColor(R.styleable.waveView_gsyWaveColor, Color.WHITE);
mColorBack = ta.getColor(R.styleable.waveView_gsyTexture_bg_waveColor, Color.TRANSPARENT);
mWaveCount = ta.getInt(R.styleable.waveView_gsyWaveCount, 2);
ta.recycle();
}

Expand Down
6 changes: 3 additions & 3 deletions waveview/src/main/java/com/shuyu/waveview/AudioWaveView.java
Original file line number Diff line number Diff line change
Expand Up @@ -139,9 +139,9 @@ public void init(Context context, AttributeSet attrs) {

if (attrs != null) {
TypedArray ta = getContext().obtainStyledAttributes(attrs, R.styleable.waveView);
mOffset = ta.getInt(R.styleable.waveView_waveOffset, dip2px(context, -11));
mWaveColor = ta.getColor(R.styleable.waveView_waveColor, Color.WHITE);
mWaveCount = ta.getInt(R.styleable.waveView_waveCount, 2);
mOffset = ta.getInt(R.styleable.waveView_gsyWaveOffset, dip2px(context, -11));
mWaveColor = ta.getColor(R.styleable.waveView_gsyWaveColor, Color.WHITE);
mWaveCount = ta.getInt(R.styleable.waveView_gsyWaveCount, 2);
ta.recycle();
}

Expand Down
8 changes: 4 additions & 4 deletions waveview/src/main/res/values/attr.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@
<resources>

<declare-styleable name="waveView">
<attr name="waveColor" format="color" />
<attr name="texture_bg_waveColor" format="color" />
<attr name="waveOffset" format="dimension" />
<attr name="waveCount" format="dimension" />
<attr name="gsyWaveColor" format="color" />
<attr name="gsyTexture_bg_waveColor" format="color" />
<attr name="gsyWaveOffset" format="dimension" />
<attr name="gsyWaveCount" format="dimension" />
</declare-styleable>

</resources>

0 comments on commit 1b1174c

Please sign in to comment.