android ImageView one finger rotation
android, rotation
Solution
I think this library can help you. https://github.com/kencheung4/android-StickerView
Problem
I looked on many posts but couldnt find the answer. I would like to rotate an root image with another small image that is located on the lower side of the root image. while rotation its working but the first time I press it, it jumps to 45 degrees because of the math.tan(), I think I have a calculation problem. ``` rotateImage.setOnTouchListener(new OnTouchListener() { @Override public boolean onTouch(View view, MotionEvent event) { final int action = MotionEventCompat.getActionMasked(event); switch (action) { case MotionEvent.ACTION_UP: break; case MotionEvent.ACTION_DOWN: rotateX = event.getRawX() - rotateImage.getWidth() / 2; rotateY = event.getRawY() - rotateImage.getHeight() / 2; break; case MotionEvent.ACTION_MOVE: float angle = (float) Math.toDegrees(Math.atan2(event.getRawY() - rotateY, event.getRawX() - rotateX)); if (angle < 0){ angle += 360; } mBinding.getRoot().setRotation(angle); } return true; } }); ``` please advice.