Loading packages/SystemUI/customization/src/com/android/systemui/shared/clocks/AnimatableClockView.kt +17 −1 Original line number Diff line number Diff line Loading @@ -27,6 +27,7 @@ import android.text.TextUtils import android.text.format.DateFormat import android.util.AttributeSet import android.util.MathUtils.constrainedMap import android.view.View import android.widget.TextView import com.android.app.animation.Interpolators import com.android.internal.annotations.VisibleForTesting Loading @@ -51,7 +52,7 @@ class AnimatableClockView @JvmOverloads constructor( context: Context, attrs: AttributeSet? = null, defStyleAttr: Int = 0, defStyleRes: Int = 0 defStyleRes: Int = 0, ) : TextView(context, attrs, defStyleAttr, defStyleRes) { // To protect us from issues from this being null while the TextView constructor is running, we // implement the get method and ensure a value is returned before initialization is complete. Loading @@ -61,6 +62,9 @@ class AnimatableClockView @JvmOverloads constructor( get() = logger.buffer set(value) { logger = Logger(value, TAG) } var hasCustomPositionUpdatedAnimation: Boolean = false var migratedClocks: Boolean = false private val time = Calendar.getInstance() private val dozingWeightInternal: Int Loading Loading @@ -193,9 +197,18 @@ class AnimatableClockView @JvmOverloads constructor( } else { animator.updateLayout(layout) } if (migratedClocks && hasCustomPositionUpdatedAnimation) { // Expand width to avoid clock being clipped during stepping animation setMeasuredDimension(measuredWidth + MeasureSpec.getSize(widthMeasureSpec) / 2, measuredHeight) } } override fun onDraw(canvas: Canvas) { if (migratedClocks && hasCustomPositionUpdatedAnimation) { canvas.save() canvas.translate((parent as View).measuredWidth / 4F, 0F) } logger.d({ "onDraw($str1)"}) { str1 = text.toString() } // Use textAnimator to render text if animation is enabled. // Otherwise default to using standard draw functions. Loading @@ -205,6 +218,9 @@ class AnimatableClockView @JvmOverloads constructor( } else { super.onDraw(canvas) } if (migratedClocks && hasCustomPositionUpdatedAnimation) { canvas.restore() } } override fun invalidate() { Loading packages/SystemUI/customization/src/com/android/systemui/shared/clocks/DefaultClockController.kt +2 −0 Original line number Diff line number Diff line Loading @@ -193,6 +193,8 @@ class DefaultClockController( ClockFaceConfig(hasCustomPositionUpdatedAnimation = hasStepClockAnimation) init { view.migratedClocks = migratedClocks view.hasCustomPositionUpdatedAnimation = hasStepClockAnimation animations = LargeClockAnimations(view, 0f, 0f) } Loading packages/SystemUI/src/com/android/systemui/keyguard/ui/view/KeyguardRootView.kt +1 −5 Original line number Diff line number Diff line Loading @@ -29,8 +29,4 @@ class KeyguardRootView( ConstraintLayout( context, attrs, ) { init { clipChildren = false } } ) Loading
packages/SystemUI/customization/src/com/android/systemui/shared/clocks/AnimatableClockView.kt +17 −1 Original line number Diff line number Diff line Loading @@ -27,6 +27,7 @@ import android.text.TextUtils import android.text.format.DateFormat import android.util.AttributeSet import android.util.MathUtils.constrainedMap import android.view.View import android.widget.TextView import com.android.app.animation.Interpolators import com.android.internal.annotations.VisibleForTesting Loading @@ -51,7 +52,7 @@ class AnimatableClockView @JvmOverloads constructor( context: Context, attrs: AttributeSet? = null, defStyleAttr: Int = 0, defStyleRes: Int = 0 defStyleRes: Int = 0, ) : TextView(context, attrs, defStyleAttr, defStyleRes) { // To protect us from issues from this being null while the TextView constructor is running, we // implement the get method and ensure a value is returned before initialization is complete. Loading @@ -61,6 +62,9 @@ class AnimatableClockView @JvmOverloads constructor( get() = logger.buffer set(value) { logger = Logger(value, TAG) } var hasCustomPositionUpdatedAnimation: Boolean = false var migratedClocks: Boolean = false private val time = Calendar.getInstance() private val dozingWeightInternal: Int Loading Loading @@ -193,9 +197,18 @@ class AnimatableClockView @JvmOverloads constructor( } else { animator.updateLayout(layout) } if (migratedClocks && hasCustomPositionUpdatedAnimation) { // Expand width to avoid clock being clipped during stepping animation setMeasuredDimension(measuredWidth + MeasureSpec.getSize(widthMeasureSpec) / 2, measuredHeight) } } override fun onDraw(canvas: Canvas) { if (migratedClocks && hasCustomPositionUpdatedAnimation) { canvas.save() canvas.translate((parent as View).measuredWidth / 4F, 0F) } logger.d({ "onDraw($str1)"}) { str1 = text.toString() } // Use textAnimator to render text if animation is enabled. // Otherwise default to using standard draw functions. Loading @@ -205,6 +218,9 @@ class AnimatableClockView @JvmOverloads constructor( } else { super.onDraw(canvas) } if (migratedClocks && hasCustomPositionUpdatedAnimation) { canvas.restore() } } override fun invalidate() { Loading
packages/SystemUI/customization/src/com/android/systemui/shared/clocks/DefaultClockController.kt +2 −0 Original line number Diff line number Diff line Loading @@ -193,6 +193,8 @@ class DefaultClockController( ClockFaceConfig(hasCustomPositionUpdatedAnimation = hasStepClockAnimation) init { view.migratedClocks = migratedClocks view.hasCustomPositionUpdatedAnimation = hasStepClockAnimation animations = LargeClockAnimations(view, 0f, 0f) } Loading
packages/SystemUI/src/com/android/systemui/keyguard/ui/view/KeyguardRootView.kt +1 −5 Original line number Diff line number Diff line Loading @@ -29,8 +29,4 @@ class KeyguardRootView( ConstraintLayout( context, attrs, ) { init { clipChildren = false } } )