android Programming Glossary: mcurrangle
How can i use RotateAnimation to rotate a circle? http://stackoverflow.com/questions/3045832/how-can-i-use-rotateanimation-to-rotate-a-circle where user's finger is. For example in your main activity do the following private ImageView mCircle private double mCurrAngle 0 private double mPrevAngle 0 @Override public void onCreate Bundle savedInstanceState super.onCreate savedInstanceState.. float x event.getX final float y event.getY switch event.getAction case MotionEvent.ACTION_DOWN mCircle.clearAnimation mCurrAngle Math.toDegrees Math.atan2 x xc yc y break case MotionEvent.ACTION_MOVE mPrevAngle mCurrAngle mCurrAngle Math.toDegrees Math.atan2.. mCircle.clearAnimation mCurrAngle Math.toDegrees Math.atan2 x xc yc y break case MotionEvent.ACTION_MOVE mPrevAngle mCurrAngle mCurrAngle Math.toDegrees Math.atan2 x xc yc y animate mPrevAngle mCurrAngle 0 break case MotionEvent.ACTION_UP mPrevAngle..
|