android - Rotate your finger ImageView limited -


i have imageview, rotate finger @ both sides. how can limit rotation 0 270 degrees? sorry bad english..

public boolean ontouch(view v, motionevent event) {      centerx = volbt.getwidth() / 2;     centery = volbt.getheight() / 2;      if (event.getaction() == motionevent.action_down)     {        savedmatrix.set(matrix);        startangle = math.atan2(event.gety() - centery, event.getx()  - centerx);     }      if (event.getaction() == motionevent.action_move)     {         double = math.atan2(event.gety() - centery, event.getx()  - centerx);         angle = (float) math.todegrees(a-startangle);          matrix.set(savedmatrix);         matrix.postrotate(angle, centerx, centery);     }      if (event.getaction() == motionevent.action_up)     {      }      volbt.setimagematrix(matrix);     return true; } 


Comments

Popular posts from this blog

sql - VB.NET Operand type clash: date is incompatible with int error -

SVG stroke-linecap doesn't work for circles in Firefox? -

python - TypeError: Scalar value for argument 'color' is not numeric in openCV -