1
예를 들어 seekbar를 100으로 이동하면 imageView가 1 초 이내에 100deg로 회전하게됩니다. 문제는 바로 50으로 이동하면 100으로 점프하고 50으로 천천히갑니다. 현재 위치에서 회전하는 방법이 있습니까? 아니면 임의의 각도에 대해보다 부드러운 애니메이션을위한 좀 더 우아한 해결책일까요?부드러운 회전
seekBar1 = (SeekBar) findViewById(R.id.seekBar1);
arrow2 = (ImageView) findViewById(R.id.imageView1);
seekBar1.setOnSeekBarChangeListener(new OnSeekBarChangeListener()
{
public void onProgressChanged(SeekBar seekBar1, int progress, boolean fromUser)
{
currentSpeed.setText(""+progress);
RotateAnimation rotateAnimation = new RotateAnimation(fromPosition ,progress,
Animation.RELATIVE_TO_SELF, 0.5f, Animation.RELATIVE_TO_SELF,
0.5f);
rotateAnimation.setInterpolator(new LinearInterpolator());
rotateAnimation.setDuration(1000);
rotateAnimation.setFillAfter(true);
arrow2.startAnimation(rotateAnimation);
fromPosition=progress;
}
public void onStartTrackingTouch(SeekBar seekSize1) {}
public void onStopTrackingTouch(SeekBar seekSize1) {}
});