Interactive Android Animation -


i trying implement interaction-animation in android user can change size of object , rotate interaction.

enter image description here

this not trying implement, similar.

i want allow user change angle line 'p' , angle 'a' should change. moving 'p' w.r.t center should allow size of shape change.

i have tried, animation , animator classes don't serve purposes.

i not asking code, need pointer on ho can implement that.

as far can tell, want line, circle, , 'a' labelled arc change respect 'p', user touches.

the line

this part relatively simple, presuming aware of how acquire x , y coordinates user clicks. firstly, you'll need override ondraw method, provide canvas element can draw on. then, when user touches screen, can draw line center of screen respective x , y coordinates.

the circle

this part relatively simple, canvas has drawcircle function draw circle around given x , y coordinate specified radius. draw circle corresponding user's touch event, use distance function calculate distance user's touch x , y coordinates center of screen coordinate, , use radius circle.

the arc

drawing arc dynamically relatively hard explain , girlfriend nagging me go eat dinner her, this question answers it, think.

also note need clear canvas on every touch event, lest previous drawings begin stacking on top of each other. cheers.


Comments

Popular posts from this blog

python - How to insert QWidgets in the middle of a Layout? -

python - serve multiple gunicorn django instances under nginx ubuntu -

module - Prestashop displayPaymentReturn hook url -