I am creating a View as below design here (like apple music).
pic 1:
pic 2:
The pink circle with physical interaction and fly. Can you suggest ways to make them?
Indeed, you should take a look at the custom view documentation.
What you should do to obtain such a result is to first override the onDraw()
method in order to make your custom drawing inside.
Using the canvas, you will be able to create circle by calling :
canvas.drawCircle(x, y, radius, paint);
In order to make the circles look as you want, just take a look at the Paint documentation. You can create as much circle as you want (the app efficiency is, of course, affected by the number of circle you draw).
With your custom view, you will be able to handle interactions easily, through the onTouchEvent()
and to animate the circle modifying their properties over time.
You need to write own View as documented here https://developer.android.com/training/custom-views/index.html and then in your onTouchEvent()
check if tap is inside or outside of area you consider checkable (in this case inside the given radius).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With