diff options
22 files changed, 113 insertions, 109 deletions
diff --git a/packages/SystemUI/src/com/android/keyguard/FontInterpolator.kt b/packages/SystemUI/animation/src/com/android/systemui/animation/FontInterpolator.kt index 962c0023cf3b..3d341af3b397 100644 --- a/packages/SystemUI/src/com/android/keyguard/FontInterpolator.kt +++ b/packages/SystemUI/animation/src/com/android/systemui/animation/FontInterpolator.kt @@ -14,7 +14,7 @@ * limitations under the License. */ -package com.android.keyguard +package com.android.systemui.animation import android.graphics.fonts.Font import android.graphics.fonts.FontVariationAxis @@ -61,7 +61,7 @@ class FontInterpolator { var index: Int, val sortedAxes: MutableList<FontVariationAxis> ) { - constructor(font: Font, axes: List<FontVariationAxis>): + constructor(font: Font, axes: List<FontVariationAxis>) : this(font.sourceIdentifier, font.ttcIndex, axes.toMutableList().apply { sortBy { it.tag } } diff --git a/packages/SystemUI/src/com/android/keyguard/TextAnimator.kt b/packages/SystemUI/animation/src/com/android/systemui/animation/TextAnimator.kt index ade89af81bd7..f79b328190dd 100644 --- a/packages/SystemUI/src/com/android/keyguard/TextAnimator.kt +++ b/packages/SystemUI/animation/src/com/android/systemui/animation/TextAnimator.kt @@ -14,7 +14,7 @@ * limitations under the License. */ -package com.android.keyguard +package com.android.systemui.animation import android.animation.Animator import android.animation.AnimatorListenerAdapter @@ -61,8 +61,8 @@ class TextAnimator( private val invalidateCallback: () -> Unit ) { // Following two members are for mutable for testing purposes. - internal var textInterpolator: TextInterpolator = TextInterpolator(layout) - internal var animator: ValueAnimator = ValueAnimator.ofFloat(1f).apply { + public var textInterpolator: TextInterpolator = TextInterpolator(layout) + public var animator: ValueAnimator = ValueAnimator.ofFloat(1f).apply { duration = DEFAULT_ANIMATION_DURATION addUpdateListener { textInterpolator.progress = it.animatedValue as Float @@ -279,4 +279,4 @@ private fun <V> SparseArray<V>.getOrElse(key: Int, defaultValue: () -> V): V { put(key, v) } return v -}
\ No newline at end of file +} diff --git a/packages/SystemUI/src/com/android/keyguard/TextInterpolator.kt b/packages/SystemUI/animation/src/com/android/systemui/animation/TextInterpolator.kt index 20dbe29efb35..ff64c7891128 100644 --- a/packages/SystemUI/src/com/android/keyguard/TextInterpolator.kt +++ b/packages/SystemUI/animation/src/com/android/systemui/animation/TextInterpolator.kt @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.android.keyguard +package com.android.systemui.animation import android.graphics.Canvas import android.graphics.Paint diff --git a/packages/SystemUI/res-keyguard/layout/keyguard_clock_switch.xml b/packages/SystemUI/res-keyguard/layout/keyguard_clock_switch.xml index 87a9825af1cb..6a38507b2ad7 100644 --- a/packages/SystemUI/res-keyguard/layout/keyguard_clock_switch.xml +++ b/packages/SystemUI/res-keyguard/layout/keyguard_clock_switch.xml @@ -31,7 +31,7 @@ android:layout_alignParentStart="true" android:layout_alignParentTop="true" android:paddingStart="@dimen/clock_padding_start"> - <com.android.keyguard.AnimatableClockView + <com.android.systemui.shared.clocks.AnimatableClockView android:id="@+id/animatable_clock_view" android:layout_width="wrap_content" android:layout_height="wrap_content" @@ -53,7 +53,7 @@ android:layout_height="wrap_content" android:layout_below="@id/keyguard_slice_view" android:visibility="gone"> - <com.android.keyguard.AnimatableClockView + <com.android.systemui.shared.clocks.AnimatableClockView android:id="@+id/animatable_clock_view_large" android:layout_width="wrap_content" android:layout_height="wrap_content" diff --git a/packages/SystemUI/res-keyguard/values/attrs.xml b/packages/SystemUI/res-keyguard/values/attrs.xml index 25be37adac5b..f2a1e26dc9ce 100644 --- a/packages/SystemUI/res-keyguard/values/attrs.xml +++ b/packages/SystemUI/res-keyguard/values/attrs.xml @@ -41,10 +41,4 @@ <attr name="passwordStyle" format="reference" /> <attr name="numPadKeyStyle" format="reference" /> - - <declare-styleable name="AnimatableClockView"> - <attr name="dozeWeight" format="integer" /> - <attr name="lockScreenWeight" format="integer" /> - <attr name="chargeAnimationDelay" format="integer" /> - </declare-styleable> </resources> diff --git a/packages/SystemUI/res-keyguard/values/donottranslate.xml b/packages/SystemUI/res-keyguard/values/donottranslate.xml index e677797dc4a7..f9872f8da192 100644 --- a/packages/SystemUI/res-keyguard/values/donottranslate.xml +++ b/packages/SystemUI/res-keyguard/values/donottranslate.xml @@ -23,11 +23,5 @@ <!-- Skeleton string format for displaying the date shorter. --> <string name="abbrev_month_day_no_year">MMMd</string> - <!-- Skeleton string format for displaying the time in 12-hour format. --> - <string name="clock_12hr_format">hm</string> - - <!-- Skeleton string format for displaying the time in 24-hour format. --> - <string name="clock_24hr_format">Hm</string> - <string name="num_pad_key_ratio">1</string> </resources> diff --git a/packages/SystemUI/shared/Android.bp b/packages/SystemUI/shared/Android.bp index 114ea657a758..165f9eba6f4c 100644 --- a/packages/SystemUI/shared/Android.bp +++ b/packages/SystemUI/shared/Android.bp @@ -47,6 +47,7 @@ android_library { ], static_libs: [ "PluginCoreLib", + "SystemUIAnimationLib", "SystemUIUnfoldLib", "androidx.dynamicanimation_dynamicanimation", "androidx.concurrent_concurrent-futures", diff --git a/packages/SystemUI/shared/res/values/attrs.xml b/packages/SystemUI/shared/res/values/attrs.xml new file mode 100644 index 000000000000..f9d66ee583da --- /dev/null +++ b/packages/SystemUI/shared/res/values/attrs.xml @@ -0,0 +1,28 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- Copyright (C) 2022 The Android Open Source Project + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +--> + +<!-- Formatting note: terminate all comments with a period, to avoid breaking + the documentation output. To suppress comment lines from the documentation + output, insert an eat-comment element after the comment lines. +--> + +<resources> + <declare-styleable name="AnimatableClockView"> + <attr name="dozeWeight" format="integer" /> + <attr name="lockScreenWeight" format="integer" /> + <attr name="chargeAnimationDelay" format="integer" /> + </declare-styleable> +</resources> diff --git a/packages/SystemUI/shared/res/values/donottranslate.xml b/packages/SystemUI/shared/res/values/donottranslate.xml new file mode 100644 index 000000000000..383d5521f156 --- /dev/null +++ b/packages/SystemUI/shared/res/values/donottranslate.xml @@ -0,0 +1,23 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- Copyright (C) 2022 The Android Open Source Project + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +--> + +<resources xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2"> + <!-- Skeleton string format for displaying the time in 12-hour format. --> + <string name="clock_12hr_format">hm</string> + + <!-- Skeleton string format for displaying the time in 24-hour format. --> + <string name="clock_24hr_format">Hm</string> +</resources> diff --git a/packages/SystemUI/src/com/android/keyguard/AnimatableClockView.kt b/packages/SystemUI/shared/src/com/android/systemui/shared/clocks/AnimatableClockView.kt index b4955d28f84b..5b1a23d4f364 100644 --- a/packages/SystemUI/src/com/android/keyguard/AnimatableClockView.kt +++ b/packages/SystemUI/shared/src/com/android/systemui/shared/clocks/AnimatableClockView.kt @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.android.keyguard +package com.android.systemui.shared.clocks import android.animation.TimeInterpolator import android.annotation.ColorInt @@ -26,9 +26,10 @@ import android.text.TextUtils import android.text.format.DateFormat import android.util.AttributeSet import android.widget.TextView -import com.android.systemui.R +import com.android.systemui.animation.GlyphCallback import com.android.systemui.animation.Interpolators -import com.android.systemui.statusbar.notification.stack.StackStateAnimator +import com.android.systemui.animation.TextAnimator +import com.android.systemui.shared.R import java.io.PrintWriter import java.util.Calendar import java.util.Locale @@ -38,13 +39,13 @@ import java.util.TimeZone * Displays the time with the hour positioned above the minutes. (ie: 09 above 30 is 9:30) * The time's text color is a gradient that changes its colors based on its controller. */ +@SuppressLint("AppCompatCustomView") class AnimatableClockView @JvmOverloads constructor( context: Context, attrs: AttributeSet? = null, defStyleAttr: Int = 0, defStyleRes: Int = 0 ) : TextView(context, attrs, defStyleAttr, defStyleRes) { - private val tag = "AnimatableClockView" private var lastMeasureCall: CharSequence = "" @@ -193,7 +194,7 @@ class AnimatableClockView @JvmOverloads constructor( ) } - fun animateFoldAppear() { + fun animateFoldAppear(animate: Boolean = true) { if (textAnimator == null) { return } @@ -210,22 +211,22 @@ class AnimatableClockView @JvmOverloads constructor( weight = dozingWeightInternal, textSize = -1f, color = dozingColor, - animate = true, + animate = animate, interpolator = Interpolators.EMPHASIZED_DECELERATE, - duration = StackStateAnimator.ANIMATION_DURATION_FOLD_TO_AOD.toLong(), + duration = ANIMATION_DURATION_FOLD_TO_AOD.toLong(), delay = 0, onAnimationEnd = null ) } - fun animateCharge(dozeStateGetter: DozeStateGetter) { + fun animateCharge(isDozing: () -> Boolean) { if (textAnimator == null || textAnimator!!.isRunning()) { // Skip charge animation if dozing animation is already playing. return } val startAnimPhase2 = Runnable { setTextStyle( - weight = if (dozeStateGetter.isDozing) dozingWeight else lockScreenWeight, + weight = if (isDozing()) dozingWeight else lockScreenWeight, textSize = -1f, color = null, animate = true, @@ -235,7 +236,7 @@ class AnimatableClockView @JvmOverloads constructor( ) } setTextStyle( - weight = if (dozeStateGetter.isDozing) lockScreenWeight else dozingWeight, + weight = if (isDozing()) lockScreenWeight else dozingWeight, textSize = -1f, color = null, animate = true, @@ -385,14 +386,14 @@ class AnimatableClockView @JvmOverloads constructor( } } - interface DozeStateGetter { - val isDozing: Boolean + companion object { + private val TAG = AnimatableClockView::class.simpleName + const val ANIMATION_DURATION_FOLD_TO_AOD: Int = 600 + private const val DOUBLE_LINE_FORMAT_12_HOUR = "hh\nmm" + private const val DOUBLE_LINE_FORMAT_24_HOUR = "HH\nmm" + private const val DOZE_ANIM_DURATION: Long = 300 + private const val APPEAR_ANIM_DURATION: Long = 350 + private const val CHARGE_ANIM_DURATION_PHASE_0: Long = 500 + private const val CHARGE_ANIM_DURATION_PHASE_1: Long = 1000 } } - -private const val DOUBLE_LINE_FORMAT_12_HOUR = "hh\nmm" -private const val DOUBLE_LINE_FORMAT_24_HOUR = "HH\nmm" -private const val DOZE_ANIM_DURATION: Long = 300 -private const val APPEAR_ANIM_DURATION: Long = 350 -private const val CHARGE_ANIM_DURATION_PHASE_0: Long = 500 -private const val CHARGE_ANIM_DURATION_PHASE_1: Long = 1000 diff --git a/packages/SystemUI/src/com/android/keyguard/AnimatableClockController.java b/packages/SystemUI/src/com/android/keyguard/AnimatableClockController.java index 487e1a48044c..c69ff7ee1cd8 100644 --- a/packages/SystemUI/src/com/android/keyguard/AnimatableClockController.java +++ b/packages/SystemUI/src/com/android/keyguard/AnimatableClockController.java @@ -32,6 +32,7 @@ import com.android.systemui.R; import com.android.systemui.broadcast.BroadcastDispatcher; import com.android.systemui.dagger.qualifiers.Main; import com.android.systemui.plugins.statusbar.StatusBarStateController; +import com.android.systemui.shared.clocks.AnimatableClockView; import com.android.systemui.statusbar.policy.BatteryController; import com.android.systemui.util.ViewController; @@ -134,6 +135,21 @@ public class AnimatableClockController extends ViewController<AnimatableClockVie reset(); } } + + @Override + public void onTimeFormatChanged(String timeFormat) { + mView.refreshFormat(); + } + + @Override + public void onTimeZoneChanged(TimeZone timeZone) { + mView.onTimeZoneChanged(timeZone); + } + + @Override + public void onUserSwitchComplete(int userId) { + mView.refreshFormat(); + } }; @Override @@ -186,7 +202,7 @@ public class AnimatableClockController extends ViewController<AnimatableClockVie /** Animate the clock appearance when a foldable device goes from fully-open/half-open state to * fully folded state and it goes to sleep (always on display screen) */ public void animateFoldAppear() { - mView.animateFoldAppear(); + mView.animateFoldAppear(true); } /** @@ -197,20 +213,6 @@ public class AnimatableClockController extends ViewController<AnimatableClockVie } /** - * Updates the timezone for the view. - */ - public void onTimeZoneChanged(TimeZone timeZone) { - mView.onTimeZoneChanged(timeZone); - } - - /** - * Trigger a time format update - */ - public void refreshFormat() { - mView.refreshFormat(); - } - - /** * Return locallly stored dozing state. */ @VisibleForTesting diff --git a/packages/SystemUI/src/com/android/keyguard/KeyguardClockSwitch.java b/packages/SystemUI/src/com/android/keyguard/KeyguardClockSwitch.java index 40edfe50d907..206b8bee323c 100644 --- a/packages/SystemUI/src/com/android/keyguard/KeyguardClockSwitch.java +++ b/packages/SystemUI/src/com/android/keyguard/KeyguardClockSwitch.java @@ -22,6 +22,7 @@ import com.android.keyguard.dagger.KeyguardStatusViewScope; import com.android.systemui.R; import com.android.systemui.animation.Interpolators; import com.android.systemui.plugins.ClockPlugin; +import com.android.systemui.shared.clocks.AnimatableClockView; import java.io.PrintWriter; import java.lang.annotation.Retention; diff --git a/packages/SystemUI/src/com/android/keyguard/KeyguardClockSwitchController.java b/packages/SystemUI/src/com/android/keyguard/KeyguardClockSwitchController.java index 5c9dd5ec26e7..6c32a4910c56 100644 --- a/packages/SystemUI/src/com/android/keyguard/KeyguardClockSwitchController.java +++ b/packages/SystemUI/src/com/android/keyguard/KeyguardClockSwitchController.java @@ -398,17 +398,6 @@ public class KeyguardClockSwitchController extends ViewController<KeyguardClockS void updateTimeZone(TimeZone timeZone) { mView.onTimeZoneChanged(timeZone); - if (mClockViewController != null) { - mClockViewController.onTimeZoneChanged(timeZone); - mLargeClockViewController.onTimeZoneChanged(timeZone); - } - } - - void refreshFormat() { - if (mClockViewController != null) { - mClockViewController.refreshFormat(); - mLargeClockViewController.refreshFormat(); - } } /** diff --git a/packages/SystemUI/src/com/android/keyguard/KeyguardStatusViewController.java b/packages/SystemUI/src/com/android/keyguard/KeyguardStatusViewController.java index 8921780fdacf..014d08288158 100644 --- a/packages/SystemUI/src/com/android/keyguard/KeyguardStatusViewController.java +++ b/packages/SystemUI/src/com/android/keyguard/KeyguardStatusViewController.java @@ -240,11 +240,6 @@ public class KeyguardStatusViewController extends ViewController<KeyguardStatusV } @Override - public void onTimeFormatChanged(String timeFormat) { - mKeyguardClockSwitchController.refreshFormat(); - } - - @Override public void onTimeZoneChanged(TimeZone timeZone) { mKeyguardClockSwitchController.updateTimeZone(timeZone); } @@ -256,11 +251,6 @@ public class KeyguardStatusViewController extends ViewController<KeyguardStatusV refreshTime(); } } - - @Override - public void onUserSwitchComplete(int userId) { - mKeyguardClockSwitchController.refreshFormat(); - } }; /** diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/StackStateAnimator.java b/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/StackStateAnimator.java index 7c9df426aba6..174bf4c27de8 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/StackStateAnimator.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/StackStateAnimator.java @@ -25,6 +25,7 @@ import android.view.View; import com.android.keyguard.KeyguardSliceView; import com.android.systemui.R; import com.android.systemui.animation.Interpolators; +import com.android.systemui.shared.clocks.AnimatableClockView; import com.android.systemui.statusbar.NotificationShelf; import com.android.systemui.statusbar.StatusBarIconView; import com.android.systemui.statusbar.notification.collection.NotificationEntry; @@ -52,7 +53,8 @@ public class StackStateAnimator { public static final int ANIMATION_DURATION_CLOSE_REMOTE_INPUT = 150; public static final int ANIMATION_DURATION_HEADS_UP_APPEAR = 400; public static final int ANIMATION_DURATION_HEADS_UP_DISAPPEAR = 400; - public static final int ANIMATION_DURATION_FOLD_TO_AOD = 600; + public static final int ANIMATION_DURATION_FOLD_TO_AOD = + AnimatableClockView.ANIMATION_DURATION_FOLD_TO_AOD; public static final int ANIMATION_DURATION_PULSE_APPEAR = KeyguardSliceView.DEFAULT_ANIM_DURATION; public static final int ANIMATION_DURATION_BLOCKING_HELPER_FADE = 240; diff --git a/packages/SystemUI/tests/src/com/android/keyguard/KeyguardClockSwitchControllerTest.java b/packages/SystemUI/tests/src/com/android/keyguard/KeyguardClockSwitchControllerTest.java index 5db2cf49636c..8b9a1e022d26 100644 --- a/packages/SystemUI/tests/src/com/android/keyguard/KeyguardClockSwitchControllerTest.java +++ b/packages/SystemUI/tests/src/com/android/keyguard/KeyguardClockSwitchControllerTest.java @@ -51,6 +51,7 @@ import com.android.systemui.dump.DumpManager; import com.android.systemui.keyguard.KeyguardUnlockAnimationController; import com.android.systemui.plugins.ClockPlugin; import com.android.systemui.plugins.statusbar.StatusBarStateController; +import com.android.systemui.shared.clocks.AnimatableClockView; import com.android.systemui.statusbar.StatusBarState; import com.android.systemui.statusbar.lockscreen.LockscreenSmartspaceController; import com.android.systemui.statusbar.phone.KeyguardBypassController; diff --git a/packages/SystemUI/tests/src/com/android/keyguard/KeyguardClockSwitchTest.java b/packages/SystemUI/tests/src/com/android/keyguard/KeyguardClockSwitchTest.java index 8717a0eaf57f..6c6f0acd7085 100644 --- a/packages/SystemUI/tests/src/com/android/keyguard/KeyguardClockSwitchTest.java +++ b/packages/SystemUI/tests/src/com/android/keyguard/KeyguardClockSwitchTest.java @@ -43,6 +43,7 @@ import android.widget.TextClock; import com.android.systemui.R; import com.android.systemui.SysuiTestCase; import com.android.systemui.plugins.ClockPlugin; +import com.android.systemui.shared.clocks.AnimatableClockView; import com.android.systemui.statusbar.StatusBarState; import org.junit.Before; diff --git a/packages/SystemUI/tests/src/com/android/keyguard/KeyguardStatusViewControllerTest.java b/packages/SystemUI/tests/src/com/android/keyguard/KeyguardStatusViewControllerTest.java index 70025230fa83..4dcaa7cf8c09 100644 --- a/packages/SystemUI/tests/src/com/android/keyguard/KeyguardStatusViewControllerTest.java +++ b/packages/SystemUI/tests/src/com/android/keyguard/KeyguardStatusViewControllerTest.java @@ -89,28 +89,6 @@ public class KeyguardStatusViewControllerTest extends SysuiTestCase { } @Test - public void timeFormatUpdateNotifiesClockSwitchController() { - mController.onViewAttached(); - - verify(mKeyguardUpdateMonitor).registerCallback( - mKeyguardUpdateMonitorCallbackCaptor.capture()); - - mKeyguardUpdateMonitorCallbackCaptor.getValue().onTimeFormatChanged(""); - verify(mKeyguardClockSwitchController).refreshFormat(); - } - - @Test - public void userChangeNotifiesClockSwitchController() { - mController.onViewAttached(); - - verify(mKeyguardUpdateMonitor).registerCallback( - mKeyguardUpdateMonitorCallbackCaptor.capture()); - - mKeyguardUpdateMonitorCallbackCaptor.getValue().onUserSwitchComplete(0); - verify(mKeyguardClockSwitchController).refreshFormat(); - } - - @Test public void setTranslationYExcludingMedia_forwardsCallToView() { float translationY = 123f; diff --git a/packages/SystemUI/tests/src/com/android/keyguard/FontInterpolatorTest.kt b/packages/SystemUI/tests/src/com/android/systemui/animation/FontInterpolatorTest.kt index 95fa3b9c594b..f01da2dd3a6b 100644 --- a/packages/SystemUI/tests/src/com/android/keyguard/FontInterpolatorTest.kt +++ b/packages/SystemUI/tests/src/com/android/systemui/animation/FontInterpolatorTest.kt @@ -14,7 +14,7 @@ * limitations under the License. */ -package com.android.keyguard +package com.android.systemui.animation import android.graphics.Paint import android.graphics.fonts.Font diff --git a/packages/SystemUI/tests/src/com/android/keyguard/TextAnimatorTest.kt b/packages/SystemUI/tests/src/com/android/systemui/animation/TextAnimatorTest.kt index 3322414e9e7a..ed0cd7ed9b24 100644 --- a/packages/SystemUI/tests/src/com/android/keyguard/TextAnimatorTest.kt +++ b/packages/SystemUI/tests/src/com/android/systemui/animation/TextAnimatorTest.kt @@ -14,7 +14,7 @@ * limitations under the License. */ -package com.android.keyguard +package com.android.systemui.animation import android.animation.AnimatorListenerAdapter import android.animation.ValueAnimator @@ -26,18 +26,17 @@ import android.text.TextPaint import androidx.test.filters.SmallTest import com.android.systemui.SysuiTestCase import com.google.common.truth.Truth.assertThat +import kotlin.math.ceil import org.junit.Test import org.junit.runner.RunWith import org.mockito.ArgumentCaptor -import org.mockito.Mockito.`when` import org.mockito.Mockito.eq import org.mockito.Mockito.inOrder import org.mockito.Mockito.mock import org.mockito.Mockito.never import org.mockito.Mockito.times import org.mockito.Mockito.verify - -import kotlin.math.ceil +import org.mockito.Mockito.`when` private val PAINT = TextPaint().apply { textSize = 32f diff --git a/packages/SystemUI/tests/src/com/android/keyguard/TextInterpolatorTest.kt b/packages/SystemUI/tests/src/com/android/systemui/animation/TextInterpolatorTest.kt index 603cf3bcef74..2a183bd43f83 100644 --- a/packages/SystemUI/tests/src/com/android/keyguard/TextInterpolatorTest.kt +++ b/packages/SystemUI/tests/src/com/android/systemui/animation/TextInterpolatorTest.kt @@ -14,7 +14,7 @@ * limitations under the License. */ -package com.android.keyguard +package com.android.systemui.animation import android.graphics.Bitmap import android.graphics.Canvas @@ -31,10 +31,10 @@ import android.text.TextPaint import androidx.test.filters.SmallTest import com.android.systemui.SysuiTestCase import com.google.common.truth.Truth.assertThat -import org.junit.Test -import org.junit.runner.RunWith import java.io.File import kotlin.math.ceil +import org.junit.Test +import org.junit.runner.RunWith private const val TEXT = "Hello, World." private const val BIDI_TEXT = "abc\u05D0\u05D1\u05D2" @@ -323,4 +323,4 @@ private fun Layout.toBitmap(width: Int, height: Int) = Bitmap.createBitmap(width, height, Bitmap.Config.ARGB_8888).also { draw(Canvas(it)) }!! private fun TextInterpolator.toBitmap(width: Int, height: Int) = - Bitmap.createBitmap(width, height, Bitmap.Config.ARGB_8888).also { draw(Canvas(it)) }
\ No newline at end of file + Bitmap.createBitmap(width, height, Bitmap.Config.ARGB_8888).also { draw(Canvas(it)) } diff --git a/packages/SystemUI/tests/src/com/android/systemui/keyguard/AnimatableClockControllerTest.java b/packages/SystemUI/tests/src/com/android/systemui/keyguard/AnimatableClockControllerTest.java index 5a4bb86dba45..df506b479b88 100644 --- a/packages/SystemUI/tests/src/com/android/systemui/keyguard/AnimatableClockControllerTest.java +++ b/packages/SystemUI/tests/src/com/android/systemui/keyguard/AnimatableClockControllerTest.java @@ -34,12 +34,12 @@ import android.view.View; import androidx.test.filters.SmallTest; import com.android.keyguard.AnimatableClockController; -import com.android.keyguard.AnimatableClockView; import com.android.keyguard.KeyguardUpdateMonitor; import com.android.settingslib.Utils; import com.android.systemui.SysuiTestCase; import com.android.systemui.broadcast.BroadcastDispatcher; import com.android.systemui.plugins.statusbar.StatusBarStateController; +import com.android.systemui.shared.clocks.AnimatableClockView; import com.android.systemui.statusbar.policy.BatteryController; import org.junit.After; |