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

Wave not show wave effect on first time when attached in Fragment #10

Open
ThanawatMas opened this issue Jul 5, 2015 · 2 comments
Open

Comments

@ThanawatMas
Copy link

When Fragment was created I injected some logic to overall view that not include waveview,
I wonder why wave is not working, but when I drag notification bar down and push it up and look up WaveView in app. The wave was worked right.

What was something that I had wrong.

PS. I try to use
waveView.invalidate();
waveView.postInvalidate();
waveView.postInvalidate(5000);
It seems not working.

@HarlonWang
Copy link
Contributor

I sovled it by this code .

In Wave.java , add this code .

java
@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();
}
}

john990 added a commit that referenced this issue Apr 5, 2016
The wave can not startWave() in onWindowFocusChanged() when in fragments . Fix it with onLayout(), See also #10
@knightbenax
Copy link

Worked for me

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants