¡@

Home 

2014/10/16 ¤W¤È 08:10:27

android Programming Glossary: balid

How to make view resizable on touch event

http://stackoverflow.com/questions/10188478/how-to-make-view-resizable-on-touch-event

new ColorBall 4 array that holds the balls private int balID 0 variable to know what ball is being dragged Paint paint Canvas.. touch down so check if the finger is on a ball balID 0 for ColorBall ball colorballs check if inside the bounds.. a ball is 22 then it must be on the ball if radCircle 23 balID ball.getID canvas.drawRect point1.x point2.x point3.x point4.x..

How to make view resizable on touch event

http://stackoverflow.com/questions/10188478/how-to-make-view-resizable-on-touch-event

Point point1 point2 point3 point4 private ColorBall colorballs new ColorBall 4 array that holds the balls private int balID 0 variable to know what ball is being dragged Paint paint Canvas canvas public DrawView Context context super context paint.. int Y int event.getY switch eventaction case MotionEvent.ACTION_DOWN touch down so check if the finger is on a ball balID 0 for ColorBall ball colorballs check if inside the bounds of the ball circle get the center for the ball int centerX.. point2.y paint if the radius is smaller then 23 radius of a ball is 22 then it must be on the ball if radCircle 23 balID ball.getID canvas.drawRect point1.x point2.x point3.x point4.x paint invalidate break invalidate canvas.drawRect point1.x..