从一侧的屏幕外到另一侧的屏幕外进行 Translate TranslateAnimation

Doing Translate TranslateAnimation from just outside the screen on one side to just outside the screen on the other side

我有一个名为 myimage 的 ImageView。

我正在这样做 TranslateAnimation 从屏幕的一侧到屏幕的另一侧。

Animation animation = new TranslateAnimation(0, 0, -1500, 1500);
animation.setDuration(1000);
animation.setFillAfter(false);
myimage.startAnimation(animation);

有什么方法可以让我将它从一侧屏幕外移动到另一侧屏幕外,而不管屏幕尺寸如何?

我已经拿到了

DisplayMetrics metrics = new DisplayMetrics();
getWindowManager().getDefaultDisplay().getMetrics(metrics);
final float screen_width_half = metrics.widthPixels/2; 
final float distance = screen_width_half + 50;

//determine half screen width and add 50 to it to take it just a little outside the screen

Animation animation = 
new TranslateAnimation(0, 0, -distance, distance);
animation.setDuration(1000);
animation.setFillAfter(false);
myimage.startAnimation(animation);