Https://github.com/traex/RippleEffect
Http://www.cnblogs.com/tiantianbyconan/p/4116304.html
- Rv_alpha is the value set in Paint.setalpha (), which is the transparency , the value range is 0---255, the smaller the value, the more transparent, the lighter the color performance.
- Rv_framerate is the Rippleeffect ripple each radius increase related to a parameter , the larger the value, each time the radius increment, the effect looks more rough.
- Rv_rippleduration is the range of the Rippleeffect Ripple, beyond which it is no longer drawn.
- Rv_zoomduration is the duration of the Rippleeffect Ripple.
- Rv_color is the color of the Rippleeffect ripple.
- The rv_centered value is true, then the ripple Trigger point is the center of the view, otherwise the position of the touch point.
- Rv_type is the type of ripple effect, simpleripple is the most common kind, only produces a circle ripple effect, doubleripple two circles ripples, rectangle effect code did not implement specifically.
- A rv_zoom value of true will have a scaled effect, rv_ripplepadding a parameter associated with the Rippleeffect ripple radius, and rv_zoomscale the scaling dimension on the y-coordinate at the end of the scaled animation.
At initialization time, the animationrunning value has been set to true, primarily to ensure that a full ripple effect is not interrupted. Canvashandler.postdelayed (runnable, framerate) is performed first, and Invalidate () is performed once every framerate time. Canvas.save () is used to save the state of the canvas, notice that Canvas.restore () is called in pairs at the end of the drawing. It then starts to draw the ripple, each time the radius increment is (Radiusmax * ((((float) 1 * framerate)/rippleduration), and every ramerate is plotted once. Rippletype = = 1 when the guarantee in the drawing to a certain time, setalpha value deepened, forming two ripples, otherwise the Setalpha value has been decreasing, the greater the ripple effect is weaker. Finally when Rippleduration <= timer * framerate, return, Rippleeffect ripple effect end.
Finally, you can use it directly in the XML:
android--Wave