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

Commit fa51548c authored by Hawkwood Glazier's avatar Hawkwood Glazier Committed by Automerger Merge Worker
Browse files

[DO NOT MERGE] Initialize TimeZone during DefaultClockProvider init am: c6bfa32a

parents b115b061 c6bfa32a
Loading
Loading
Loading
Loading
+3 −16
Original line number Diff line number Diff line
@@ -61,11 +61,7 @@ interface Clock {

    /** Initializes various rendering parameters. If never called, provides reasonable defaults. */
    fun initialize(resources: Resources, dozeFraction: Float, foldFraction: Float) {
        events.onColorPaletteChanged(
                resources,
                ClockDarkness.DEFAULT,
                ClockDarkness.DEFAULT
        )
        events.onColorPaletteChanged(resources, true, true)
        animations.doze(dozeFraction)
        animations.fold(foldFraction)
        events.onTimeTick()
@@ -95,8 +91,8 @@ interface ClockEvents {
    /** Call whenever the color palette should update */
    fun onColorPaletteChanged(
            resources: Resources,
            smallClockIsDark: ClockDarkness,
            largeClockIsDark: ClockDarkness
            smallClockIsDark: Boolean,
            largeClockIsDark: Boolean
    ) { }
}

@@ -120,12 +116,3 @@ data class ClockMetadata(
    val clockId: ClockId,
    val name: String
)

/**
 * Enum for whether clock region is dark or light.
 */
enum class ClockDarkness(val isDark: Boolean) {
    DEFAULT(true),
    DARK(true),
    LIGHT(false)
}
+4 −6
Original line number Diff line number Diff line
@@ -23,6 +23,7 @@
    android:id="@+id/keyguard_clock_container"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:clipChildren="false"
    android:layout_gravity="center_horizontal|top">
    <FrameLayout
        android:id="@+id/lockscreen_clock_view"
@@ -30,16 +31,13 @@
        android:layout_height="wrap_content"
        android:layout_alignParentStart="true"
        android:layout_alignParentTop="true"
        android:paddingStart="@dimen/clock_padding_start">
    </FrameLayout>
        android:paddingStart="@dimen/clock_padding_start" />
    <FrameLayout
        android:id="@+id/lockscreen_clock_view_large"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:layout_below="@id/keyguard_slice_view"
        android:paddingTop="@dimen/keyguard_large_clock_top_padding"
        android:visibility="gone">
    </FrameLayout>
        android:layout_marginTop="@dimen/keyguard_large_clock_top_margin"
        android:visibility="gone" />

    <!-- Not quite optimal but needed to translate these items as a group. The
         NotificationIconContainer has its own logic for translation. -->
+1 −1
Original line number Diff line number Diff line
@@ -669,7 +669,7 @@
    <!-- When large clock is showing, offset the smartspace by this amount -->
    <dimen name="keyguard_smartspace_top_offset">12dp</dimen>
    <!-- With the large clock, move up slightly from the center -->
    <dimen name="keyguard_large_clock_top_padding">100dp</dimen>
    <dimen name="keyguard_large_clock_top_margin">-60dp</dimen>

    <dimen name="notification_scrim_corner_radius">32dp</dimen>

+1 −1
Original line number Diff line number Diff line
@@ -18,7 +18,7 @@
-->
<com.android.systemui.shared.clocks.AnimatableClockView
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="wrap_content"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:layout_gravity="start"
    android:gravity="start"
+12 −10
Original line number Diff line number Diff line
@@ -29,6 +29,7 @@ import android.util.AttributeSet
import android.widget.TextView
import com.android.internal.R.attr.contentDescription
import com.android.internal.R.attr.format
import com.android.internal.annotations.VisibleForTesting
import com.android.systemui.animation.GlyphCallback
import com.android.systemui.animation.Interpolators
import com.android.systemui.animation.TextAnimator
@@ -77,7 +78,8 @@ class AnimatableClockView @JvmOverloads constructor(
    private var textAnimator: TextAnimator? = null
    private var onTextAnimatorInitialized: Runnable? = null

    var timeOverrideInMillis: Long? = null
    @VisibleForTesting var isAnimationEnabled: Boolean = true
    @VisibleForTesting var timeOverrideInMillis: Long? = null

    val dozingWeight: Int
        get() = if (useBoldedVersion()) dozingWeightInternal + 100 else dozingWeightInternal
@@ -218,7 +220,7 @@ class AnimatableClockView @JvmOverloads constructor(
    }

    fun animateAppearOnLockscreen() {
        if (textAnimator == null) {
        if (isAnimationEnabled && textAnimator == null) {
            return
        }
        setTextStyle(
@@ -234,7 +236,7 @@ class AnimatableClockView @JvmOverloads constructor(
            weight = lockScreenWeight,
            textSize = -1f,
            color = lockScreenColor,
            animate = true,
            animate = isAnimationEnabled,
            duration = APPEAR_ANIM_DURATION,
            delay = 0,
            onAnimationEnd = null
@@ -242,7 +244,7 @@ class AnimatableClockView @JvmOverloads constructor(
    }

    fun animateFoldAppear(animate: Boolean = true) {
        if (textAnimator == null) {
        if (isAnimationEnabled && textAnimator == null) {
            return
        }
        setTextStyle(
@@ -258,7 +260,7 @@ class AnimatableClockView @JvmOverloads constructor(
            weight = dozingWeightInternal,
            textSize = -1f,
            color = dozingColor,
            animate = animate,
            animate = animate && isAnimationEnabled,
            interpolator = Interpolators.EMPHASIZED_DECELERATE,
            duration = ANIMATION_DURATION_FOLD_TO_AOD.toLong(),
            delay = 0,
@@ -276,7 +278,7 @@ class AnimatableClockView @JvmOverloads constructor(
                weight = if (isDozing()) dozingWeight else lockScreenWeight,
                textSize = -1f,
                color = null,
                animate = true,
                animate = isAnimationEnabled,
                duration = CHARGE_ANIM_DURATION_PHASE_1,
                delay = 0,
                onAnimationEnd = null
@@ -286,7 +288,7 @@ class AnimatableClockView @JvmOverloads constructor(
            weight = if (isDozing()) lockScreenWeight else dozingWeight,
            textSize = -1f,
            color = null,
            animate = true,
            animate = isAnimationEnabled,
            duration = CHARGE_ANIM_DURATION_PHASE_0,
            delay = chargeAnimationDelay.toLong(),
            onAnimationEnd = startAnimPhase2
@@ -298,7 +300,7 @@ class AnimatableClockView @JvmOverloads constructor(
            weight = if (isDozing) dozingWeight else lockScreenWeight,
            textSize = -1f,
            color = if (isDozing) dozingColor else lockScreenColor,
            animate = animate,
            animate = animate && isAnimationEnabled,
            duration = DOZE_ANIM_DURATION,
            delay = 0,
            onAnimationEnd = null
@@ -332,7 +334,7 @@ class AnimatableClockView @JvmOverloads constructor(
                weight = weight,
                textSize = textSize,
                color = color,
                animate = animate,
                animate = animate && isAnimationEnabled,
                duration = duration,
                interpolator = interpolator,
                delay = delay,
@@ -370,7 +372,7 @@ class AnimatableClockView @JvmOverloads constructor(
            weight = weight,
            textSize = textSize,
            color = color,
            animate = animate,
            animate = animate && isAnimationEnabled,
            interpolator = null,
            duration = duration,
            delay = delay,
Loading