开发者

High cpu load during animation

开发者 https://www.devze.com 2023-03-05 09:11 出处:网络
During the animation the cpu load is very high (up to 75%) Is there a method to optimize the code to get lower cpu load?

During the animation the cpu load is very high (up to 75%)

Is there a method to optimize the code to get lower cpu load?

My code:

ImageView myImageView = (ImageView)findViewById(R.id.ImageView02);

    animSet = new AnimationSet(true);

    animSet.setInterpolator(new LinearInterpolator());
    animSet.setFillAfter(true);
    animSet.setFillEnabled(true);

    final RotateAnimation animRotate = new RotateAnimation(0.0f, 360.0f,
            RotateAnimation.RELATIVE_TO_SELF, 0.5f,
            RotateAnimation.RELATIVE_TO_SELF, 0.5f);
    animRotate.setRepeatCount(Animation.INFINITE);
    animRotate.setDuration(rotor_duration());
    animRotate.setFillAfter(true);
    animSet开发者_开发技巧.addAnimation(animRotate);

    myImageView.startAnimation(animSet);


Is there a method to set delay between rotations ? By setting a delay and setting a bigger value for the angle (to keep rotation speed constant) should help.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号