特定の持続時間と角度パラメーターに基づいて RotateAnimation を作成し、異なる持続時間と角度パラメーターで同じアニメーションを呼び出したい場合、どうすればよいですか?
RotateAnimation animation = new RotateAnimation(fromDegrees, toDegrees, width, height/2);
animation.setInterpolator(new LinearInterpolator());
animation.setDuration(animationDuration);
animation.setFillAfter(true);
animation.setAnimationListener(new Animation.AnimationListener() {
@Override
public void onAnimationStart(Animation animation) {
activityTimeOrRepeat.setText(task.getDurationTitle());
activityTimeOrRepeat.setTextColor(textColor);
activityDescription.setText(task.getTitle());
activityDescription.setTextColor(textColor);
timeLeftForThisActivity.setTextColor(textColor);
currentTimerIndex[0] = index;
}
@Override
public void onAnimationRepeat(Animation animation) {
}
@Override
public void onAnimationEnd(Animation animation) {
timeLeftForThisActivity.setText("00:00");
CountDownTimer currentTimer = timers[index];
currentTimer.cancel();
if (index == taskSize - 1) {
overallTimer[0].cancel();
startButton.setBackgroundDrawable(context.getResources().getDrawable(R.drawable.done_button_master));
startButton.setTag(context.getString(R.string.wtrDoneButtonTag));
elapsedTimeDynamic.setText(String.format("%02d:%02d", (totalActivityTime / 1000) / 60, (totalActivityTime / 1000) % 60));
}
else {
RotateAnimation nextAnimation = animations[index + 1];
CountDownTimer nextTimer = timers[index + 1];
nextTimer.start();
workoutWidget.startAnimation(nextAnimation);
}
}
});
これを同じアニメーションと呼ぶにはどうすればよいですか?ただし、期間と度合いのパラメーターは異なります。