I want to rotate a picture (Bitmap within a ImageView) around his center. This works pretty well by using the preRotate method with the values width/2 and height/2 of the Bitmap and 1 or -1 degree as rotation factor.
But I implemented the rotation functions as Buttons. Everytime the Button "rotate right" is pressed the Imageview rotates one degree to the right and so on. It would be nice to press the Button and while the Button is pressed the picture starts rotating until the button is released.
I've read some threads here in which these feature is implemented as OnTouchListener instead of OnClickListener, but it does not work for me. If I implement loops within the MotionEvent.ACTION_DOWN event then they are infinite. If I don't use loops then the event is only handled once (like in OnClickListener).
So how can I increment/decrement the rotation factor while a button is pressed?