Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 09c6d494 authored by Robert Snoeberger's avatar Robert Snoeberger
Browse files

Include minute interpolation on hour hand angle.

This will move the hand across more pixels and help mitigate burn in.

Bug: 122301289
Test: atest frameworks/base/packages/SystemUI/tests/src/com/android/keyguard/clock/
Change-Id: I8ea0adb2c5bc35e16a902818c4ef39059342b3ba
parent 19e3e2ad
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -59,7 +59,7 @@ public class ImageClock extends FrameLayout {
     */
    public void onTimeChanged() {
        mTime.setTimeInMillis(System.currentTimeMillis());
        final float hourAngle = mTime.get(Calendar.HOUR) * 30f;
        final float hourAngle = mTime.get(Calendar.HOUR) * 30f + mTime.get(Calendar.MINUTE) * 0.5f;
        mHourHand.setRotation(hourAngle);
        final float minuteAngle = mTime.get(Calendar.MINUTE) * 6f;
        mMinuteHand.setRotation(minuteAngle);
+2 −1
Original line number Diff line number Diff line
@@ -103,7 +103,8 @@ public class StretchAnalogClock extends View {
        final float centerY = getHeight() / 2f;

        final float minutesRotation = mTime.get(Calendar.MINUTE) * 6f;
        final float hoursRotation = (mTime.get(Calendar.HOUR) * 30);
        final float hoursRotation = mTime.get(Calendar.HOUR) * 30
                + mTime.get(Calendar.MINUTE) * 0.5f;

        // Compute length of clock hands. Hour hand is 60% the length from center to edge
        // and minute hand is twice the length to make sure it extends past screen edge.