如何将ObjectAnimator动画设为mp4视频?

时间:2018-03-07 10:54:25

标签: java android android-layout android-animation android-annotations

我正在尝试为m4视频创建ObjectAnimator动画。
有人给我解决方案吗?

ObjectAnimator动画代码:

 public void animation(){

    ObjectAnimator fadeOut = ObjectAnimator.ofFloat(aniView, "alpha", 0f);
    fadeOut.setDuration(1000);

    ObjectAnimator mover = ObjectAnimator.ofFloat(aniView, "translationY", -700f, 0f);
    mover.setDuration(1000);

    ObjectAnimator fadeIn = ObjectAnimator.ofFloat(aniView, "alpha", 0.8f, 1f);
    fadeIn.setDuration(1000);
    AnimatorSet animatorSet = new AnimatorSet();

    // animatorSet.play(mover).with(fadeIn).after(fadeOut);
    animatorSet.play(fadeOut).after(mover).with(fadeIn);
    animatorSet.start();
}

1 个答案:

答案 0 :(得分:0)

您无法为视频创建ObjectAnimator。您只能为用于显示视频的View制作动画。