Android custom imitation 360Root master water print effect, android360root
A simple effect. I went straight.
The code is not detailed. Just paste the key code.
@ Override protected void onDraw (Canvas canvas) {super. onDraw (canvas); canvas. save (); canvas. drawCircle (width/2, height/2, interRadius, interCirclePaint); if (list! = Null & list. size ()> 0) {int listSize = list. size (); int removeIndex =-1; for (int I = 0; I <listSize; I ++) {CircleInfo mcircleInfo = list. get (I); outPaint. setColor (mcircleInfo. color); outPaint. setAlpha (255-mcircleInfo. radius * 255/outCircleMaxRadius); mcircleInfo. radius = mcircleInfo. radius + 1; if (mcircleInfo. radius> outCircleMaxRadius) {removeIndex = I;} else {canvas. drawCircle (width/2, height/2, mcircleInfo. radius, outPaint) ;}}if (removeIndex> 0) {list. remove (removeIndex); removeIndex =-1 ;}} canvas. restore ();
If (list = null) {animatorControl ();}
PostInvalidate ();}
Code: https://github.com/flyme2012/EasyWave
Copyright Disclaimer: This article is an original article by the blogger and cannot be reproduced without the permission of the blogger.