Skip to content

Commit

Permalink
re commit
Browse files Browse the repository at this point in the history
  • Loading branch information
shota-saito committed Aug 1, 2017
1 parent b2af145 commit 349b8e2
Showing 1 changed file with 22 additions and 21 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -139,27 +139,28 @@ public void start() {
minuteAnimator.start();
}

void setTime(ClockTime newTime) {
long minutesDifference = getMinutesDifference(previousTime, newTime);
// 60min ... 360grade
// minDif .. minDelta
float minDeltaRotation = ((float) minutesDifference * 360f) / 60f;
// 720min ... 360grade = 12h ... 360grade
// minDif ... hourDelta
float hourDeltaRotation = ((float) minutesDifference * 360f) / 720f;

remainingMinRotation += minDeltaRotation;
remainingHourRotation += hourDeltaRotation;

targetHourRotation = currentHourRotation + remainingHourRotation;
targetMinRotation = currentMinRotation + remainingMinRotation;

start();

previousTime = newTime;

invalidateSelf();
}
// TODO:
// void setTime(ClockTime newTime) {
// long minutesDifference = getMinutesDifference(previousTime, newTime);
// // 60min ... 360grade
// // minDif .. minDelta
// float minDeltaRotation = ((float) minutesDifference * 360f) / 60f;
// // 720min ... 360grade = 12h ... 360grade
// // minDif ... hourDelta
// float hourDeltaRotation = ((float) minutesDifference * 360f) / 720f;
//
// remainingMinRotation += minDeltaRotation;
// remainingHourRotation += hourDeltaRotation;
//
// targetHourRotation = currentHourRotation + remainingHourRotation;
// targetMinRotation = currentMinRotation + remainingMinRotation;
//
// start();
//
// previousTime = newTime;
//
// invalidateSelf();
// }

void animate(ClockTime newTime) {
long minutesDifference = getMinutesDifference(previousTime, newTime);
Expand Down

0 comments on commit 349b8e2

Please # to comment.