如何计算旋转匹配?

时间:2019-02-27 16:08:02

标签: java android xml

  

如何在Java中计算旋转图像匹配。给我一个建议。

public void onClickButtonRotation(View v){
    if(this.blnButtonRotation){
        int run = new Random().nextInt(360) + 3600;
        RotateAnimation rotateAnimation = new RotateAnimation((float)this.intDegrees,(float)
                (this.intDegrees + ((long)run)),1,0.5f,1,0.5f);
        this.intDegrees = (this.intDegrees + ((long)run)) % 360;
        rotateAnimation.setDuration((long)run);
        rotateAnimation.setFillAfter(true);
        rotateAnimation.setInterpolator(new DecelerateInterpolator());
        rotateAnimation.setAnimationListener(this);
        imageRoulette.setAnimation(rotateAnimation);
        imageRoulette.startAnimation(rotateAnimation);
    }
}

0 个答案:

没有答案