I'm trying to figure out the best way to make an image rotate along with a user's finger dragging it left or right, and the angle of rotation.
float x1 = lastEvent[0] - lastEvent[1];
float y1 = lastEvent[2] - lastEvent[3];
float degrees1 = (float)(Math.atan2(y1, x1));
float x2 = event.getX(0) - event.getX(1);
float y2 = event.getY(0) - event.getY(1);
float degrees2 = (float)(Math.atan2(y2, x2));
float degrees = (float) Math.toDegrees(degrees2-degrees1);
But it doesn't rotate like i want it.. Is there any listener for rotation gesture? Thanks