我希望在播放时不触摸(*无拖动,无用户参与)移动视频视图,移动应该在对角线路径中从屏幕的右上角到左下角。我尝试了不同的动画,但我无法实现这一点,试过以下代码。
mVideoView = (VideoView) findViewById(R.id.videoview2);
animateVideoView(mVideoView);
private void animateVideoView(View v){
DisplayMetrics displayMetrics = new DisplayMetrics();
getWindowManager().getDefaultDisplay().getMetrics(displayMetrics);
final int height = displayMetrics.heightPixels;
final int width = displayMetrics.widthPixels;
ObjectAnimator y = ObjectAnimator.ofFloat(v,
"translationY", width, 100);
ObjectAnimator x = ObjectAnimator.ofFloat(v,
"translationX",100,height);
animSetXY.playTogether(x, y);
animSetXY.setInterpolator(new LinearInterpolator());
animSetXY.setDuration(5000);
animSetXY.start();
v.startAnimation(animSetXY);
}
任何帮助将不胜感激......