Skip to content
This repository has been archived by the owner on Mar 10, 2021. It is now read-only.

Commit

Permalink
Merge pull request #12 from 81813780/master
Browse files Browse the repository at this point in the history
The wave can not startWave() in onWindowFocusChanged() when in fragments . Fix it with onLayout(), See also #10
  • Loading branch information
john990 committed Apr 5, 2016
2 parents d0e0201 + 891a319 commit 3da6d4b
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions library/src/main/java/com/john/waveview/Wave.java
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,14 @@ public void onWindowFocusChanged(boolean hasWindowFocus) {
}
}

@Override
protected void onLayout(boolean changed, int left, int top, int right, int bottom) {
super.onLayout(changed, left, top, right, bottom);
if (mWaveLength==0){
startWave();
}
}

private void startWave() {
if (getWidth() != 0) {
int width = getWidth();
Expand Down

0 comments on commit 3da6d4b

Please sign in to comment.