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

android - Why am I getting the message 'Youractivity.java is not an activity subclass or alias' -

python - How do I create a list index that loops through integers in another list -

c# - “System.Security.Cryptography.CryptographicException: Keyset does not exist” when reading private key from remote machine -