触发:
VideoWrapper videoWrapper = new VideoWrapper(); AnimatorSet set = new AnimatorSet(); set.playTogether( ObjectAnimator.ofFloat(videoWrapper, "width", 0, 1100), ObjectAnimator.ofFloat(videoWrapper, "height", 0, 1100) ); set.addListener(new AnimatorListenerAdapter() { @Override public void onAnimationEnd(Animator animation) { super.onAnimationEnd(animation); } }); set.setDuration(500).start();VideoWrapper类(mVideoViewSurfaceView为显示视频的View):
class VideoWrapper { private ViewGroup.LayoutParams params; VideoWrapper() { params = mVideoViewSurfaceView.getLayoutParams(); } public int getWidth() { return params.width; } public int getHeight() { return params.height; } public void setWidth(float w) { params.width = (int) w; mVideoViewSurfaceView.setLayoutParams(params); } public void setHeight(float h) { params.height = (int) h; mVideoViewSurfaceView.setLayoutParams(params); } }