Add androidx.core.animation dependency for better testability
Using ObjectAnimator, ValueAnimator or Interpolators from `androidx.core.animation` has the advantage of improving the testability compared to using them from `android.view.animation`. The `core-animation-testing` dependency (not included in this CL), and specifically the AnimatorTestRule (https://developer.android.com/reference/androidx/core/animation/AnimatorTestRule) allows for things such as `animatorTestRule.advanceTimeBy(500L)`. This enables us to fast forward animations and verify things that happen after an animation has ended.
Test: atest InterpolatorsAndroidXTest
Bug: 259063937
Change-Id: I196eb325e4c99dda163445e6fed84327bebecfb2
diff --git a/packages/SystemUI/animation/Android.bp b/packages/SystemUI/animation/Android.bp
index f7bcf1f..5df79e1 100644
--- a/packages/SystemUI/animation/Android.bp
+++ b/packages/SystemUI/animation/Android.bp
@@ -36,8 +36,29 @@
static_libs: [
"PluginCoreLib",
+ "androidx.core_core-animation-nodeps",
],
manifest: "AndroidManifest.xml",
kotlincflags: ["-Xjvm-default=all"],
}
+
+android_test {
+ name: "SystemUIAnimationLibTests",
+
+ static_libs: [
+ "SystemUIAnimationLib",
+ "androidx.test.ext.junit",
+ "androidx.test.rules",
+ "testables",
+ ],
+ libs: [
+ "android.test.base",
+ ],
+ srcs: [
+ "**/*.java",
+ "**/*.kt",
+ ],
+ kotlincflags: ["-Xjvm-default=all"],
+ test_suites: ["general-tests"],
+}