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

Commit aea5a1ae authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Include minute interpolation on hour hand angle."

parents d3d14432 09c6d494
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.