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

Commit e32efd76 authored by Robert Snoeberger's avatar Robert Snoeberger
Browse files

Add setDarkAmount method to ClockPlugin interface.

setDarmAmount implementations provided by clock plugins
should use the dark amount to transition into and out
of the doze state on AOD. For example, the size of the
clock could shrink in the Y direction when leaving doze
to make room for the notification stack scroller.

Bug: 119035943
Test: KeyguardClockSwitchTest passes locally.
Change-Id: I9968dc2cc5ab8000ff525f3d1d06ffbf73359086
parent 56b5a1fb
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -49,4 +49,10 @@ public interface ClockPlugin extends Plugin {
     * Notifies that time tick alarm from doze service fired.
     */
    default void dozeTimeTick() { }

    /**
     * Set the amount (ratio) that the device has transitioned to doze.
     * @param darkAmount Amount of transition to doze: 1f for doze and 0f for awake.
     */
    default void setDarkAmount(float darkAmount) {}
}
+10 −0
Original line number Diff line number Diff line
@@ -126,6 +126,16 @@ public class KeyguardClockSwitch extends FrameLayout {
        mClockView.setFormat24Hour(format);
    }

    /**
     * Set the amount (ratio) that the device has transitioned to doze.
     * @param darkAmount Amount of transition to doze: 1f for doze and 0f for awake.
     */
    public void setDarkAmount(float darkAmount) {
        if (mClockPlugin != null) {
            mClockPlugin.setDarkAmount(darkAmount);
        }
    }

    public Paint getPaint() {
        return mClockView.getPaint();
    }
+1 −0
Original line number Diff line number Diff line
@@ -385,6 +385,7 @@ public class KeyguardStatusView extends GridLayout implements
            return;
        }
        mDarkAmount = darkAmount;
        mClockView.setDarkAmount(darkAmount);
        updateDark();
    }