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

Commit e1b6d7f8 authored by Beverly's avatar Beverly Committed by Beverly Tai
Browse files

Update AOD/LS clock

- Update clock sizes (large clock = 200dp, small clock = 100dp)
- Update clock weights (large = 100-400, small = 200-300)
- Update clocks on time zone and time format changes
	(Settings > System > Date & Time)

Test: manual, atest SystemUITests
Bug: 170228350
Change-Id: I446a2625fdd776c15e744f1601b3ea0e2a873cf1
parent 648d4e5e
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -126,6 +126,13 @@ public interface ClockPlugin extends Plugin {
     */
    default void onTimeZoneChanged(TimeZone timeZone) {}

    /**
     * Notifies that the time format has changed.
     *
     * @param timeFormat "12" for 12-hour format, "24" for 24-hour format
     */
    default void onTimeFormatChanged(String timeFormat) {}

    /**
     * Indicates whether the keyguard status area (date) should be shown below
     * the clock.
+6 −2
Original line number Diff line number Diff line
@@ -73,13 +73,15 @@
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:gravity="right"
            android:textSize="80dp"
            android:textSize="100dp"
            android:letterSpacing="0.02"
            android:lineSpacingMultiplier=".8"
            android:includeFontPadding="false"
            android:fontFamily="@font/clock"
            android:typeface="monospace"
            android:elegantTextHeight="false"
            dozeWeight="200"
            lockScreenWeight="300"
        />
    </FrameLayout>
    <FrameLayout
@@ -95,13 +97,15 @@
            android:layout_height="wrap_content"
            android:layout_gravity="center_horizontal"
            android:gravity="center_horizontal"
            android:textSize="180dp"
            android:textSize="200dp"
            android:letterSpacing="0.02"
            android:lineSpacingMultiplier=".8"
            android:includeFontPadding="false"
            android:fontFamily="@font/clock"
            android:typeface="monospace"
            android:elegantTextHeight="false"
            dozeWeight="100"
            lockScreenWeight="400"
        />
    </FrameLayout>
    <include layout="@layout/keyguard_status_area"
+5 −0
Original line number Diff line number Diff line
@@ -39,4 +39,9 @@
    </declare-styleable>

    <attr name="passwordStyle" format="reference" />

    <declare-styleable name="AnimatableClockView">
        <attr name="dozeWeight" format="integer" />
        <attr name="lockScreenWeight" format="integer" />
    </declare-styleable>
</resources>
+0 −1
Original line number Diff line number Diff line
@@ -138,5 +138,4 @@
        <item name="android:shadowColor">@color/keyguard_shadow_color</item>
        <item name="android:shadowRadius">?attr/shadowRadius</item>
    </style>

</resources>
+17 −1
Original line number Diff line number Diff line
@@ -24,6 +24,8 @@ import com.android.settingslib.Utils;
import com.android.systemui.plugins.statusbar.StatusBarStateController;
import com.android.systemui.util.ViewController;

import java.util.TimeZone;

/**
 * Controls the color of a GradientTextClock.
 */
@@ -62,12 +64,26 @@ public class AnimatableClockController extends ViewController<AnimatableClockVie
    }

    /**
     * Updates the time for this view.
     * Updates the time for the view.
     */
    public void refreshTime() {
        mView.refreshTime();
    }

    /**
     * Updates the timezone for the view.
     */
    public void onTimeZoneChanged(TimeZone timeZone) {
        mView.onTimeZoneChanged(timeZone);
    }

    /**
     * Trigger a time format update
     */
    public void refreshFormat() {
        mView.refreshFormat();
    }

    private void initColors() {
        mLockScreenColors[0] = Utils.getColorAttrDefaultColor(getContext(),
                com.android.systemui.R.attr.wallpaperTextColor);
Loading