자동차 계기판처럼 움직이는 바늘을 만들고 있습니다
버튼이 눌리면 90도 각도를 회전(한쪽끝을 축으로 틸트) 하고
그상태가 유지되다 값이 다시 버튼을 누르면 추가로 회전하는
버튼한번누를때마다 90도씩 회전하는 핀 애니메이션을 구현하고 싶은데
FillAfter를 이용해서 첫번째 애니매이션이 끝나고 그상태가 유지되는것까지는 만들었으나
그뒤에 다른값이 들어올 경우 유지된 상태(각도)에서 다른 각도로 움직이는 애니메이션을 만들지 못하고 있습니다.
방법이 있을까요?
아래는 버튼의 onClic 코드입니다
RotateAnimation dd = new RotateAnimation(0,90,RotateAnimation.RELATIVE_TO_SELF,0.5f,RotateAnimation.RELATIVE_TO_SELF,0.85f);
dd.setFillBefore(true);
dd.setFillAfter(true);
dd.setDuration(500);
dd.setRepeatCount(0);
//dd.setInterpolator();
dd.setAnimationListener(new Animation.AnimationListener() {
@Override
public void onAnimationStart(Animation animation) {
}
@Override
public void onAnimationEnd(Animation animation) {
}
@Override
public void onAnimationRepeat(Animation animation) {
}
});
imageView.setAnimation(dd);
imageView.startAnimation(dd);