Переместить изображение по кругу в Android

У меня есть изображение, я хотел переместить его по кругуonClick() событие кнопки без анимации,

Я не знаю, как это сделать .. Любая помощь?

Это мой основной класс

public class MainActivity extends Activity {
MyAnimation animation;
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_main);
    animation =new MyAnimation ();

}

и я использую код, указанный вами как

public class MyAnimation extends Animation {
float cx,cy,prevX,prevY,r;

@Override
protected void applyTransformation(float interpolatedTime, Transformation t) {
    super.applyTransformation(interpolatedTime, t);

    float angle = (float) (interpolatedTime * 2 * Math.PI);
    // r = radius, cx and cy = center point, a = angle (radians)
    float x = (float) (cx + r * Math.cos(angle)) ; 
    float y = (float) (cy + r * Math.sin(angle));

    float dx = prevX - x;
    float dy = prevY - y;

    prevX = x;
    prevY = y;

    t.getMatrix().setTranslate(dx, dy);
}

}

И это мой xml изображения, который я хотел переместить в круглую форму.

<ImageView
    android:id="@+id/myanimation"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_centerHorizontal="true"
    android:layout_centerVertical="true"
    android:src="@drawable/ic_launcher" />

Ответы на вопрос(1)

Ваш ответ на вопрос