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

Commit 6add973e authored by Isaac Katzenelson's avatar Isaac Katzenelson
Browse files

Put the seconds hand on top in the analog clock

Bug: 7555265
Change-Id: I4be90e5960492b0c8d38d7d2c52bd0dd18f0c6e0
parent 97ac21e3
Loading
Loading
Loading
Loading
+14 −13
Original line number Diff line number Diff line
@@ -61,8 +61,8 @@ public class AnalogClock extends View {
    private String mTimeZoneId;
    private boolean mNoSeconds = false;

    private float mDotRadius;
    private float mDotOffset;
    private final float mDotRadius;
    private final float mDotOffset;
    private Paint mDotPaint;

    public AnalogClock(Context context) {
@@ -218,6 +218,18 @@ public class AnalogClock extends View {
        hourHand.draw(canvas);
        canvas.restore();

        canvas.save();
        canvas.rotate(mMinutes / 60.0f * 360.0f, x, y);

        final Drawable minuteHand = mMinuteHand;
        if (changed) {
            w = minuteHand.getIntrinsicWidth();
            h = minuteHand.getIntrinsicHeight();
            minuteHand.setBounds(x - (w / 2), y - (h / 2), x + (w / 2), y + (h / 2));
        }
        minuteHand.draw(canvas);
        canvas.restore();

        if (!mNoSeconds) {
            canvas.save();
            canvas.rotate(mSeconds / 60.0f * 360.0f, x, y);
@@ -231,17 +243,6 @@ public class AnalogClock extends View {
            secondHand.draw(canvas);
            canvas.restore();
        }
        canvas.save();
        canvas.rotate(mMinutes / 60.0f * 360.0f, x, y);

        final Drawable minuteHand = mMinuteHand;
        if (changed) {
            w = minuteHand.getIntrinsicWidth();
            h = minuteHand.getIntrinsicHeight();
            minuteHand.setBounds(x - (w / 2), y - (h / 2), x + (w / 2), y + (h / 2));
        }
        minuteHand.draw(canvas);
        canvas.restore();

        if (scaled) {
            canvas.restore();