Android: Custom View for simulating water wave effects, android Water Wave
Github address: https://github.com/nuptboyzhb/WaterWaveView
Welcome Fork, welcome Star
1. Check the effect first.
2. Check the key code again.
Plotting Function y = Asin (wx + d) + offset
/*** Use the Path to depict the drawn area ** @ return */private Path getFristWavePath () {// draw the Path of Area 1 if (firstWavePath = null) {firstWavePath = new Path ();} firstWavePath. reset (); firstWavePath. moveTo (0, height); // move to the point in the lower left corner for (float x = 0; x <= width; x + = X_STEP) {float y = (float) (waveHeight * Math. sin (omega * x + moveWave) + waveHeight) + heightOffset; firstWavePath. lineTo (x, y);} firstWavePath. lineTo (width, 0); firstWavePath. lineTo (width, height); return firstWavePath ;}
More communication
QQ group of Android Development Alliance:272209595