I have a circle and I want to place an image on the circle.
I know the angle and the circle radius and I need to get x and y coordinates for placing the image.
The image have to be ON the circle and not IN.
Code :
private void placeImageOnCircle(ImageView circle, RelativeLayout imageToMove, int angle)
{
int radius = circle.getWidth()/2;
// get marginX and marginY...
RelativeLayout.LayoutParams params = new RelativeLayout.LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT);
params.setMargins(marginX, marginY, 0, 0);
imageToMove.setLayoutParams(params);
}