Problem with save state on the wave view
Hello,
I implemented a wave view in fragment with 30 % loaded. I implemented the fragment in the viewpager.
When i switch few pages ("fragments") and I'm back. But the 30 % of the wave_view drew 100 %.
I try to update the view all time and set 30 % the progress. But, this didn't work.
I have a same problem!!!
This problems have to solve?
Having same issue, anyone solved this?
Hi all, I have same problem and my solution is to add OnGlobalLayoutListener in fragment's onResume method. Then You can set progress on wave view.
@Override public void onResume() { super.onResume(); RecyclerView.getViewTreeObserver().addOnGlobalLayoutListener(new ViewTreeObserver.OnGlobalLayoutListener() { @Override public void onGlobalLayout() { WaveView.setProgress(30); RecyclerView.getViewTreeObserver().removeOnGlobalLayoutListener(this); } }); }
I hope this will help anyone ;)
It works! Thanks :)