mirror of
https://github.com/LawnchairLauncher/lawnchair.git
synced 2026-03-04 01:46:49 +00:00
Merge "Add a new bubble at limit while expanded" into main
This commit is contained in:
committed by
Android (Google) Code Review
commit
fde4fdc472
@@ -80,6 +80,31 @@ class BubbleAnimatorTest {
|
||||
assertThat(bubbleAnimator.isRunning).isFalse()
|
||||
}
|
||||
|
||||
@Test
|
||||
fun animateNewAndRemoveOld_isRunning() {
|
||||
bubbleAnimator =
|
||||
BubbleAnimator(
|
||||
iconSize = 40f,
|
||||
expandedBarIconSpacing = 10f,
|
||||
bubbleCount = 5,
|
||||
onLeft = false
|
||||
)
|
||||
val listener = TestBubbleAnimatorListener()
|
||||
InstrumentationRegistry.getInstrumentation().runOnMainSync {
|
||||
bubbleAnimator.animateNewAndRemoveOld(
|
||||
selectedBubbleIndex = 3,
|
||||
removedBubbleIndex = 2,
|
||||
listener
|
||||
)
|
||||
}
|
||||
|
||||
assertThat(bubbleAnimator.isRunning).isTrue()
|
||||
InstrumentationRegistry.getInstrumentation().runOnMainSync {
|
||||
animatorTestRule.advanceTimeBy(250)
|
||||
}
|
||||
assertThat(bubbleAnimator.isRunning).isFalse()
|
||||
}
|
||||
|
||||
private class TestBubbleAnimatorListener : BubbleAnimator.Listener {
|
||||
|
||||
override fun onAnimationUpdate(animatedFraction: Float) {}
|
||||
|
||||
Reference in New Issue
Block a user