-3

I want to make an animation have some circles. They will draw from small to big look like water ripple effect.

Look like that

How to make it with Android code?

Please help me!!!

user1118321
  • 25,567
  • 4
  • 55
  • 86
abc xyz
  • 3
  • 3
  • 3
    What have you tried. In general, asking for code is frowned upon; this site is more geared to helping fix code versus writing from whole cloth. – Foon Mar 11 '15 at 11:06
  • I'm newbie :( . I'm using scale but it have a problem, width of ring will be increase. – abc xyz Mar 11 '15 at 11:17
  • Just increase the value of the radius argument when you call canvas.drawCircle() – 1337ingDisorder Mar 11 '15 at 11:20
  • 1
    @abc xyz. We were all newbies once (of course when I was a newb, if I wanted something more advanced than basic, I had to write the assembly by hand, convert into machine op codes, convert those from hexadecimal to decimal, use basic pokes to load into memory, and then hope it worked because in addition to not having a compiler or an assembler, I also didn't have a real debugger). Anyways, if you provide the code, the problem changes dramatically from how do I draw animation with circles to how do I modify my code to make it look better which should be a much more bounded problem. – Foon Mar 11 '15 at 11:29
  • Found a library https://github.com/skyfishjy/android-ripple-background – Rohan Kandwal Jul 24 '15 at 09:50

1 Answers1

1

Start by learning about drawing Circles on Canvas:

http://www.compiletimeerror.com/2013/09/introduction-to-2d-drawing-in-android.html#.VQAjCVXd_NE

Once you have the hang of that just increase the size of the circle incrementally with each frame being drawn (and, optionally, fade the color or alpha value of the circle as it approaches the large end of the size range)

NOTE: You'll probably want to change the line that says:

paint.setStyle(Paint.Style.FILL);

...to say:

paint.setStyle(Paint.Style.STROKE);
1337ingDisorder
  • 821
  • 1
  • 6
  • 17