I am trying to rotate one of the transparent PNGs in this image. The digital part is what I want to rotate. I can do it, but thatโs not what I'm trying to achieve.

I want to rotate numbers, like on a real combination lock. Thus, the user will touch and move his finger in a circle. I looked at less accurate image rotation on touch / move events, and there werenโt enough of them.
this is currently my code
public boolean onTouch(View v, MotionEvent event) { double r=Math.atan2(event.getX()-lockNumbers.getWidth(), lockNumbers.getHeight()-event.getY()); int rotation=(int)Math.toDegrees(r); switch (event.getAction()) { case MotionEvent.ACTION_DOWN: break; case MotionEvent.ACTION_MOVE: x=event.getX(); y=event.getY(); updateRotation(rotation); break; case MotionEvent.ACTION_UP: break; }
it also resizes the bitmap when it is touched due to the matrix parameter. This is not the desired effect.
The user will largely need to walk in a circle with a finger.
source share