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
Post a Comment