OpeningActivity.java 文件源码

java
阅读 18 收藏 0 点赞 0 评论 0

项目:StarWarsOpening 作者:
private void startIntroTextAnimation() {
    if ( Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
        Animator introAnimator = AnimatorInflater.loadAnimator(this, R.animator.intro);
        introAnimator.setTarget(introTextView);
        introAnimator.start();
    } else {
        Keyframe kf0 = Keyframe.ofFloat(0f, 0);
        Keyframe kf1 = Keyframe.ofFloat(.2f, 1);
        Keyframe kf2 = Keyframe.ofFloat(.9f, 1);
        Keyframe kf3 = Keyframe.ofFloat(1f, 0);
        PropertyValuesHolder pvh = PropertyValuesHolder.ofKeyframe("alpha", kf0, kf1, kf2, kf3);
        ObjectAnimator alphaAnimator = ObjectAnimator.ofPropertyValuesHolder(introTextView, pvh);
        alphaAnimator.setInterpolator(new DecelerateInterpolator());
        alphaAnimator.setDuration(6000).setStartDelay(1000);
        alphaAnimator.start();
    }
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号