diff --git a/src/com/google/android/apps/nexuslauncher/clock/AutoUpdateClock.java b/src/com/google/android/apps/nexuslauncher/clock/AutoUpdateClock.java index 044fb8dfb5..e33c5da5d6 100644 --- a/src/com/google/android/apps/nexuslauncher/clock/AutoUpdateClock.java +++ b/src/com/google/android/apps/nexuslauncher/clock/AutoUpdateClock.java @@ -17,10 +17,8 @@ public class AutoUpdateClock extends FastBitmapDrawable implements Runnable { } private void rescheduleUpdate() { - long millisInSecond = 1000L; unscheduleSelf(this); - long uptimeMillis = SystemClock.uptimeMillis(); - scheduleSelf(this, uptimeMillis - uptimeMillis % millisInSecond + millisInSecond); + scheduleSelf(this, SystemClock.uptimeMillis() + 100); } void updateLayers(ClockLayers layers) { @@ -42,7 +40,6 @@ public class AutoUpdateClock extends FastBitmapDrawable implements Runnable { public void drawInternal(Canvas canvas, Rect bounds) { if (mLayers != null) { canvas.drawBitmap(mLayers.iconBitmap, null, bounds, mPaint); - mLayers.updateAngles(); canvas.scale(mLayers.scale, mLayers.scale, bounds.exactCenterX() + ((float) mLayers.offset), bounds.exactCenterY() + ((float) mLayers.offset)); mLayers.clipToMask(canvas); mLayers.drawForeground(canvas); diff --git a/src/com/google/android/apps/nexuslauncher/clock/ClockLayers.java b/src/com/google/android/apps/nexuslauncher/clock/ClockLayers.java index 812705d9a9..dc4c9d7597 100644 --- a/src/com/google/android/apps/nexuslauncher/clock/ClockLayers.java +++ b/src/com/google/android/apps/nexuslauncher/clock/ClockLayers.java @@ -75,6 +75,7 @@ public class ClockLayers { int hour = (mCurrentTime.get(Calendar.HOUR) + (12 - mDefaultHour)) % 12; int minute = (mCurrentTime.get(Calendar.MINUTE) + (60 - mDefaultMinute)) % 60; int second = (mCurrentTime.get(Calendar.SECOND) + (60 - mDefaultSecond)) % 60; + int millis = second * 1000 + mCurrentTime.get(Calendar.MILLISECOND); boolean hasChanged = false; if (mHourIndex != -1 && mLayerDrawable.getDrawable(mHourIndex).setLevel(hour * 60 + mCurrentTime.get(Calendar.MINUTE))) { @@ -83,7 +84,7 @@ public class ClockLayers { if (mMinuteIndex != -1 && mLayerDrawable.getDrawable(mMinuteIndex).setLevel(minute + mCurrentTime.get(Calendar.HOUR) * 60)) { hasChanged = true; } - if (mSecondIndex != -1 && mLayerDrawable.getDrawable(mSecondIndex).setLevel(second * 10)) { + if (mSecondIndex != -1 && mLayerDrawable.getDrawable(mSecondIndex).setLevel(millis / 100)) { hasChanged = true; } return hasChanged;