runSec
方法を組み合わせて、1 つの方法でrunMin
手を動かしたいと考えています。これらのメソッドは、文字盤の分針と秒針を動かします。
public void settTime(int seconds) {
if(isTimer)
return;
tTime = seconds;
int minutes = seconds / 60;
int hours = minutes / 60;
minutes = minutes % 60;
seconds = seconds % 60;
tTimeLabel.setText(String.format("%02d:%02d:%02d", hours, minutes, seconds));
runSec(seconds);
runMin(minutes);
}
public void runSec(int seconds) {
RotateAnimation rotateAnimation = new RotateAnimation(seconds * 6, seconds * 6,
Animation.RELATIVE_TO_SELF, 0.5f,Animation.RELATIVE_TO_SELF, 0.5f);
rotateAnimation.setFillAfter(true);
csecond.startAnimation(rotateAnimation);
}
public void runMin(int minutes) {
RotateAnimation rotateAnimation = new RotateAnimation(minutes * 6, minutes * 6,
Animation.RELATIVE_TO_SELF, 0.5f,Animation.RELATIVE_TO_SELF, 0.5f);
rotateAnimation.setFillAfter(true);
cminute.startAnimation(rotateAnimation);
}