Loading packages/SystemUI/src/com/android/systemui/dreams/touch/BouncerSwipeTouchHandler.java +22 −17 Original line number Diff line number Diff line Loading @@ -31,8 +31,8 @@ import android.view.MotionEvent; import android.view.VelocityTracker; import com.android.systemui.statusbar.NotificationShadeWindowController; import com.android.systemui.statusbar.phone.KeyguardBouncer; import com.android.systemui.statusbar.phone.CentralSurfaces; import com.android.systemui.statusbar.phone.KeyguardBouncer; import com.android.systemui.statusbar.phone.StatusBarKeyguardViewManager; import com.android.wm.shell.animation.FlingAnimationUtils; Loading Loading @@ -134,9 +134,9 @@ public class BouncerSwipeTouchHandler implements DreamTouchHandler { NotificationShadeWindowController notificationShadeWindowController, ValueAnimatorCreator valueAnimatorCreator, VelocityTrackerFactory velocityTrackerFactory, @Named(SWIPE_TO_BOUNCER_FLING_ANIMATION_UTILS_CLOSING) FlingAnimationUtils flingAnimationUtils, @Named(SWIPE_TO_BOUNCER_FLING_ANIMATION_UTILS_OPENING) FlingAnimationUtils flingAnimationUtils, @Named(SWIPE_TO_BOUNCER_FLING_ANIMATION_UTILS_CLOSING) FlingAnimationUtils flingAnimationUtilsClosing, @Named(SWIPE_TO_BOUNCER_START_REGION) float swipeRegionPercentage) { mDisplayMetrics = displayMetrics; Loading @@ -154,11 +154,14 @@ public class BouncerSwipeTouchHandler implements DreamTouchHandler { public void getTouchInitiationRegion(Region region) { if (mCentralSurfaces.isBouncerShowing()) { region.op(new Rect(0, 0, mDisplayMetrics.widthPixels, Math.round(mDisplayMetrics.heightPixels * mBouncerZoneScreenPercentage)), Math.round( mDisplayMetrics.heightPixels * mBouncerZoneScreenPercentage)), Region.Op.UNION); } else { region.op(new Rect(0, Math.round(mDisplayMetrics.heightPixels * (1 - mBouncerZoneScreenPercentage)), Math.round( mDisplayMetrics.heightPixels * (1 - mBouncerZoneScreenPercentage)), mDisplayMetrics.widthPixels, mDisplayMetrics.heightPixels), Region.Op.UNION); Loading Loading @@ -210,7 +213,6 @@ public class BouncerSwipeTouchHandler implements DreamTouchHandler { final float velocityVector = (float) Math.hypot(horizontalVelocity, verticalVelocity); final float expansion = flingRevealsOverlay(verticalVelocity, velocityVector) ? KeyguardBouncer.EXPANSION_HIDDEN : KeyguardBouncer.EXPANSION_VISIBLE; flingToExpansion(verticalVelocity, expansion); Loading @@ -236,8 +238,8 @@ public class BouncerSwipeTouchHandler implements DreamTouchHandler { } protected boolean flingRevealsOverlay(float velocity, float velocityVector) { // Fully expand if the user has expanded the bouncer less than halfway or final velocity was // positive, indicating an downward direction. // Fully expand the space above the bouncer, if the user has expanded the bouncer less // than halfway or final velocity was positive, indicating a downward direction. if (Math.abs(velocityVector) < mFlingAnimationUtils.getMinVelocityPxPerSecond()) { return mCurrentExpansion > FLING_PERCENTAGE_THRESHOLD; } else { Loading @@ -246,17 +248,20 @@ public class BouncerSwipeTouchHandler implements DreamTouchHandler { } protected void flingToExpansion(float velocity, float expansion) { // The animation utils deal in pixel units, rather than expansion height. final float viewHeight = mCentralSurfaces.getDisplayHeight(); final float currentHeight = viewHeight * mCurrentExpansion; final float targetHeight = viewHeight * expansion; final ValueAnimator animator = createExpansionAnimator(expansion); if (expansion == KeyguardBouncer.EXPANSION_HIDDEN) { // The animation utils deal in pixel units, rather than expansion height. mFlingAnimationUtils.apply(animator, currentHeight, targetHeight, velocity, viewHeight); // Hides the bouncer, i.e., fully expands the space above the bouncer. mFlingAnimationUtilsClosing.apply(animator, currentHeight, targetHeight, velocity, viewHeight); } else { mFlingAnimationUtilsClosing.apply( animator, mCurrentExpansion, currentHeight, targetHeight, viewHeight); // Shows the bouncer, i.e., fully collapses the space above the bouncer. mFlingAnimationUtils.apply( animator, currentHeight, targetHeight, velocity, viewHeight); } animator.start(); Loading packages/SystemUI/tests/src/com/android/systemui/dreams/touch/BouncerSwipeTouchHandlerTest.java +102 −19 Original line number Diff line number Diff line Loading @@ -39,8 +39,8 @@ import androidx.test.filters.SmallTest; import com.android.systemui.SysuiTestCase; import com.android.systemui.shared.system.InputChannelCompat; import com.android.systemui.statusbar.NotificationShadeWindowController; import com.android.systemui.statusbar.phone.KeyguardBouncer; import com.android.systemui.statusbar.phone.CentralSurfaces; import com.android.systemui.statusbar.phone.KeyguardBouncer; import com.android.systemui.statusbar.phone.StatusBarKeyguardViewManager; import com.android.wm.shell.animation.FlingAnimationUtils; Loading Loading @@ -112,8 +112,10 @@ public class BouncerSwipeTouchHandlerTest extends SysuiTestCase { TOUCH_REGION); when(mCentralSurfaces.getDisplayHeight()).thenReturn((float) SCREEN_HEIGHT_PX); when(mCentralSurfaces.isBouncerShowing()).thenReturn(false); when(mValueAnimatorCreator.create(anyFloat(), anyFloat())).thenReturn(mValueAnimator); when(mVelocityTrackerFactory.obtain()).thenReturn(mVelocityTracker); when(mFlingAnimationUtils.getMinVelocityPxPerSecond()).thenReturn(Float.MAX_VALUE); } /** Loading Loading @@ -154,7 +156,7 @@ public class BouncerSwipeTouchHandlerTest extends SysuiTestCase { * Makes sure expansion amount is proportional to scroll. */ @Test public void testExpansionAmount() { public void testExpansionAmount_whenBouncerHidden_setsCorrectValue() { mTouchHandler.onSessionStart(mTouchSession); ArgumentCaptor<GestureDetector.OnGestureListener> gestureListenerCaptor = ArgumentCaptor.forClass(GestureDetector.OnGestureListener.class); Loading @@ -180,6 +182,38 @@ public class BouncerSwipeTouchHandlerTest extends SysuiTestCase { .onPanelExpansionChanged(eq(1 - scrollAmount), eq(false), eq(true)); } /** * Makes sure expansion amount is proportional to scroll. */ @Test public void testExpansionAmount_whenBouncerShown_setsCorrectValue() { when(mCentralSurfaces.isBouncerShowing()).thenReturn(true); mTouchHandler.onSessionStart(mTouchSession); ArgumentCaptor<GestureDetector.OnGestureListener> gestureListenerCaptor = ArgumentCaptor.forClass(GestureDetector.OnGestureListener.class); verify(mTouchSession).registerGestureListener(gestureListenerCaptor.capture()); final float scrollAmount = .3f; final float distanceY = SCREEN_HEIGHT_PX * scrollAmount; final MotionEvent event1 = MotionEvent.obtain(0, 0, MotionEvent.ACTION_MOVE, 0, SCREEN_HEIGHT_PX, 0); final MotionEvent event2 = MotionEvent.obtain(0, 0, MotionEvent.ACTION_MOVE, 0, SCREEN_HEIGHT_PX - distanceY, 0); assertThat(gestureListenerCaptor.getValue().onScroll(event1, event2, 0, distanceY)) .isTrue(); // Ensure only called once verify(mStatusBarKeyguardViewManager) .onPanelExpansionChanged(anyFloat(), anyBoolean(), anyBoolean()); // Ensure correct expansion passed in. verify(mStatusBarKeyguardViewManager) .onPanelExpansionChanged(eq(scrollAmount), eq(false), eq(true)); } private void swipeToPosition(float position, float velocityY) { mTouchHandler.onSessionStart(mTouchSession); ArgumentCaptor<GestureDetector.OnGestureListener> gestureListenerCaptor = Loading Loading @@ -212,14 +246,18 @@ public class BouncerSwipeTouchHandlerTest extends SysuiTestCase { * down. */ @Test public void testCollapseOnThreshold() { public void testSwipeBelowThreshold_collapsesBouncer() { final float swipeUpPercentage = .3f; swipeToPosition(swipeUpPercentage, -1); verify(mValueAnimatorCreator).create(eq(1 - swipeUpPercentage), eq(KeyguardBouncer.EXPANSION_VISIBLE)); verify(mFlingAnimationUtilsClosing).apply(eq(mValueAnimator), anyFloat(), anyFloat(), anyFloat(), anyFloat()); final float expansion = 1 - swipeUpPercentage; // The upward velocity is ignored. final float velocityY = -1; swipeToPosition(swipeUpPercentage, velocityY); verify(mValueAnimatorCreator).create(eq(expansion), eq(KeyguardBouncer.EXPANSION_HIDDEN)); verify(mFlingAnimationUtilsClosing).apply(eq(mValueAnimator), eq(SCREEN_HEIGHT_PX * expansion), eq(SCREEN_HEIGHT_PX * KeyguardBouncer.EXPANSION_HIDDEN), eq(velocityY), eq((float) SCREEN_HEIGHT_PX)); verify(mValueAnimator).start(); } Loading @@ -227,14 +265,59 @@ public class BouncerSwipeTouchHandlerTest extends SysuiTestCase { * Tests that ending a swipe above the set expansion threshold will continue the expansion. */ @Test public void testExpandOnThreshold() { public void testSwipeAboveThreshold_expandsBouncer() { final float swipeUpPercentage = .7f; final float expansion = 1 - swipeUpPercentage; // The downward velocity is ignored. final float velocityY = 1; swipeToPosition(swipeUpPercentage, velocityY); verify(mValueAnimatorCreator).create(eq(expansion), eq(KeyguardBouncer.EXPANSION_VISIBLE)); verify(mFlingAnimationUtils).apply(eq(mValueAnimator), eq(SCREEN_HEIGHT_PX * expansion), eq(SCREEN_HEIGHT_PX * KeyguardBouncer.EXPANSION_VISIBLE), eq(velocityY), eq((float) SCREEN_HEIGHT_PX)); verify(mValueAnimator).start(); } /** * Tests that swiping down with a speed above the set threshold leads to bouncer collapsing * down. */ @Test public void testSwipeDownVelocityAboveMin_collapsesBouncer() { when(mFlingAnimationUtils.getMinVelocityPxPerSecond()).thenReturn((float) 0); // The swipe amount above the set expansion threshold is ignored. final float swipeUpPercentage = .7f; swipeToPosition(swipeUpPercentage, 1); final float expansion = 1 - swipeUpPercentage; final float velocityY = 1; swipeToPosition(swipeUpPercentage, velocityY); verify(mValueAnimatorCreator).create(eq(expansion), eq(KeyguardBouncer.EXPANSION_HIDDEN)); verify(mFlingAnimationUtilsClosing).apply(eq(mValueAnimator), eq(SCREEN_HEIGHT_PX * expansion), eq(SCREEN_HEIGHT_PX * KeyguardBouncer.EXPANSION_HIDDEN), eq(velocityY), eq((float) SCREEN_HEIGHT_PX)); verify(mValueAnimator).start(); } /** * Tests that swiping up with a speed above the set threshold will continue the expansion. */ @Test public void testSwipeUpVelocityAboveMin_expandsBouncer() { when(mFlingAnimationUtils.getMinVelocityPxPerSecond()).thenReturn((float) 0); verify(mValueAnimatorCreator).create(eq(1 - swipeUpPercentage), eq(KeyguardBouncer.EXPANSION_HIDDEN)); verify(mFlingAnimationUtils).apply(eq(mValueAnimator), anyFloat(), anyFloat(), anyFloat(), anyFloat()); // The swipe amount below the set expansion threshold is ignored. final float swipeUpPercentage = .3f; final float expansion = 1 - swipeUpPercentage; final float velocityY = -1; swipeToPosition(swipeUpPercentage, velocityY); verify(mValueAnimatorCreator).create(eq(expansion), eq(KeyguardBouncer.EXPANSION_VISIBLE)); verify(mFlingAnimationUtils).apply(eq(mValueAnimator), eq(SCREEN_HEIGHT_PX * expansion), eq(SCREEN_HEIGHT_PX * KeyguardBouncer.EXPANSION_VISIBLE), eq(velocityY), eq((float) SCREEN_HEIGHT_PX)); verify(mValueAnimator).start(); } } Loading
packages/SystemUI/src/com/android/systemui/dreams/touch/BouncerSwipeTouchHandler.java +22 −17 Original line number Diff line number Diff line Loading @@ -31,8 +31,8 @@ import android.view.MotionEvent; import android.view.VelocityTracker; import com.android.systemui.statusbar.NotificationShadeWindowController; import com.android.systemui.statusbar.phone.KeyguardBouncer; import com.android.systemui.statusbar.phone.CentralSurfaces; import com.android.systemui.statusbar.phone.KeyguardBouncer; import com.android.systemui.statusbar.phone.StatusBarKeyguardViewManager; import com.android.wm.shell.animation.FlingAnimationUtils; Loading Loading @@ -134,9 +134,9 @@ public class BouncerSwipeTouchHandler implements DreamTouchHandler { NotificationShadeWindowController notificationShadeWindowController, ValueAnimatorCreator valueAnimatorCreator, VelocityTrackerFactory velocityTrackerFactory, @Named(SWIPE_TO_BOUNCER_FLING_ANIMATION_UTILS_CLOSING) FlingAnimationUtils flingAnimationUtils, @Named(SWIPE_TO_BOUNCER_FLING_ANIMATION_UTILS_OPENING) FlingAnimationUtils flingAnimationUtils, @Named(SWIPE_TO_BOUNCER_FLING_ANIMATION_UTILS_CLOSING) FlingAnimationUtils flingAnimationUtilsClosing, @Named(SWIPE_TO_BOUNCER_START_REGION) float swipeRegionPercentage) { mDisplayMetrics = displayMetrics; Loading @@ -154,11 +154,14 @@ public class BouncerSwipeTouchHandler implements DreamTouchHandler { public void getTouchInitiationRegion(Region region) { if (mCentralSurfaces.isBouncerShowing()) { region.op(new Rect(0, 0, mDisplayMetrics.widthPixels, Math.round(mDisplayMetrics.heightPixels * mBouncerZoneScreenPercentage)), Math.round( mDisplayMetrics.heightPixels * mBouncerZoneScreenPercentage)), Region.Op.UNION); } else { region.op(new Rect(0, Math.round(mDisplayMetrics.heightPixels * (1 - mBouncerZoneScreenPercentage)), Math.round( mDisplayMetrics.heightPixels * (1 - mBouncerZoneScreenPercentage)), mDisplayMetrics.widthPixels, mDisplayMetrics.heightPixels), Region.Op.UNION); Loading Loading @@ -210,7 +213,6 @@ public class BouncerSwipeTouchHandler implements DreamTouchHandler { final float velocityVector = (float) Math.hypot(horizontalVelocity, verticalVelocity); final float expansion = flingRevealsOverlay(verticalVelocity, velocityVector) ? KeyguardBouncer.EXPANSION_HIDDEN : KeyguardBouncer.EXPANSION_VISIBLE; flingToExpansion(verticalVelocity, expansion); Loading @@ -236,8 +238,8 @@ public class BouncerSwipeTouchHandler implements DreamTouchHandler { } protected boolean flingRevealsOverlay(float velocity, float velocityVector) { // Fully expand if the user has expanded the bouncer less than halfway or final velocity was // positive, indicating an downward direction. // Fully expand the space above the bouncer, if the user has expanded the bouncer less // than halfway or final velocity was positive, indicating a downward direction. if (Math.abs(velocityVector) < mFlingAnimationUtils.getMinVelocityPxPerSecond()) { return mCurrentExpansion > FLING_PERCENTAGE_THRESHOLD; } else { Loading @@ -246,17 +248,20 @@ public class BouncerSwipeTouchHandler implements DreamTouchHandler { } protected void flingToExpansion(float velocity, float expansion) { // The animation utils deal in pixel units, rather than expansion height. final float viewHeight = mCentralSurfaces.getDisplayHeight(); final float currentHeight = viewHeight * mCurrentExpansion; final float targetHeight = viewHeight * expansion; final ValueAnimator animator = createExpansionAnimator(expansion); if (expansion == KeyguardBouncer.EXPANSION_HIDDEN) { // The animation utils deal in pixel units, rather than expansion height. mFlingAnimationUtils.apply(animator, currentHeight, targetHeight, velocity, viewHeight); // Hides the bouncer, i.e., fully expands the space above the bouncer. mFlingAnimationUtilsClosing.apply(animator, currentHeight, targetHeight, velocity, viewHeight); } else { mFlingAnimationUtilsClosing.apply( animator, mCurrentExpansion, currentHeight, targetHeight, viewHeight); // Shows the bouncer, i.e., fully collapses the space above the bouncer. mFlingAnimationUtils.apply( animator, currentHeight, targetHeight, velocity, viewHeight); } animator.start(); Loading
packages/SystemUI/tests/src/com/android/systemui/dreams/touch/BouncerSwipeTouchHandlerTest.java +102 −19 Original line number Diff line number Diff line Loading @@ -39,8 +39,8 @@ import androidx.test.filters.SmallTest; import com.android.systemui.SysuiTestCase; import com.android.systemui.shared.system.InputChannelCompat; import com.android.systemui.statusbar.NotificationShadeWindowController; import com.android.systemui.statusbar.phone.KeyguardBouncer; import com.android.systemui.statusbar.phone.CentralSurfaces; import com.android.systemui.statusbar.phone.KeyguardBouncer; import com.android.systemui.statusbar.phone.StatusBarKeyguardViewManager; import com.android.wm.shell.animation.FlingAnimationUtils; Loading Loading @@ -112,8 +112,10 @@ public class BouncerSwipeTouchHandlerTest extends SysuiTestCase { TOUCH_REGION); when(mCentralSurfaces.getDisplayHeight()).thenReturn((float) SCREEN_HEIGHT_PX); when(mCentralSurfaces.isBouncerShowing()).thenReturn(false); when(mValueAnimatorCreator.create(anyFloat(), anyFloat())).thenReturn(mValueAnimator); when(mVelocityTrackerFactory.obtain()).thenReturn(mVelocityTracker); when(mFlingAnimationUtils.getMinVelocityPxPerSecond()).thenReturn(Float.MAX_VALUE); } /** Loading Loading @@ -154,7 +156,7 @@ public class BouncerSwipeTouchHandlerTest extends SysuiTestCase { * Makes sure expansion amount is proportional to scroll. */ @Test public void testExpansionAmount() { public void testExpansionAmount_whenBouncerHidden_setsCorrectValue() { mTouchHandler.onSessionStart(mTouchSession); ArgumentCaptor<GestureDetector.OnGestureListener> gestureListenerCaptor = ArgumentCaptor.forClass(GestureDetector.OnGestureListener.class); Loading @@ -180,6 +182,38 @@ public class BouncerSwipeTouchHandlerTest extends SysuiTestCase { .onPanelExpansionChanged(eq(1 - scrollAmount), eq(false), eq(true)); } /** * Makes sure expansion amount is proportional to scroll. */ @Test public void testExpansionAmount_whenBouncerShown_setsCorrectValue() { when(mCentralSurfaces.isBouncerShowing()).thenReturn(true); mTouchHandler.onSessionStart(mTouchSession); ArgumentCaptor<GestureDetector.OnGestureListener> gestureListenerCaptor = ArgumentCaptor.forClass(GestureDetector.OnGestureListener.class); verify(mTouchSession).registerGestureListener(gestureListenerCaptor.capture()); final float scrollAmount = .3f; final float distanceY = SCREEN_HEIGHT_PX * scrollAmount; final MotionEvent event1 = MotionEvent.obtain(0, 0, MotionEvent.ACTION_MOVE, 0, SCREEN_HEIGHT_PX, 0); final MotionEvent event2 = MotionEvent.obtain(0, 0, MotionEvent.ACTION_MOVE, 0, SCREEN_HEIGHT_PX - distanceY, 0); assertThat(gestureListenerCaptor.getValue().onScroll(event1, event2, 0, distanceY)) .isTrue(); // Ensure only called once verify(mStatusBarKeyguardViewManager) .onPanelExpansionChanged(anyFloat(), anyBoolean(), anyBoolean()); // Ensure correct expansion passed in. verify(mStatusBarKeyguardViewManager) .onPanelExpansionChanged(eq(scrollAmount), eq(false), eq(true)); } private void swipeToPosition(float position, float velocityY) { mTouchHandler.onSessionStart(mTouchSession); ArgumentCaptor<GestureDetector.OnGestureListener> gestureListenerCaptor = Loading Loading @@ -212,14 +246,18 @@ public class BouncerSwipeTouchHandlerTest extends SysuiTestCase { * down. */ @Test public void testCollapseOnThreshold() { public void testSwipeBelowThreshold_collapsesBouncer() { final float swipeUpPercentage = .3f; swipeToPosition(swipeUpPercentage, -1); verify(mValueAnimatorCreator).create(eq(1 - swipeUpPercentage), eq(KeyguardBouncer.EXPANSION_VISIBLE)); verify(mFlingAnimationUtilsClosing).apply(eq(mValueAnimator), anyFloat(), anyFloat(), anyFloat(), anyFloat()); final float expansion = 1 - swipeUpPercentage; // The upward velocity is ignored. final float velocityY = -1; swipeToPosition(swipeUpPercentage, velocityY); verify(mValueAnimatorCreator).create(eq(expansion), eq(KeyguardBouncer.EXPANSION_HIDDEN)); verify(mFlingAnimationUtilsClosing).apply(eq(mValueAnimator), eq(SCREEN_HEIGHT_PX * expansion), eq(SCREEN_HEIGHT_PX * KeyguardBouncer.EXPANSION_HIDDEN), eq(velocityY), eq((float) SCREEN_HEIGHT_PX)); verify(mValueAnimator).start(); } Loading @@ -227,14 +265,59 @@ public class BouncerSwipeTouchHandlerTest extends SysuiTestCase { * Tests that ending a swipe above the set expansion threshold will continue the expansion. */ @Test public void testExpandOnThreshold() { public void testSwipeAboveThreshold_expandsBouncer() { final float swipeUpPercentage = .7f; final float expansion = 1 - swipeUpPercentage; // The downward velocity is ignored. final float velocityY = 1; swipeToPosition(swipeUpPercentage, velocityY); verify(mValueAnimatorCreator).create(eq(expansion), eq(KeyguardBouncer.EXPANSION_VISIBLE)); verify(mFlingAnimationUtils).apply(eq(mValueAnimator), eq(SCREEN_HEIGHT_PX * expansion), eq(SCREEN_HEIGHT_PX * KeyguardBouncer.EXPANSION_VISIBLE), eq(velocityY), eq((float) SCREEN_HEIGHT_PX)); verify(mValueAnimator).start(); } /** * Tests that swiping down with a speed above the set threshold leads to bouncer collapsing * down. */ @Test public void testSwipeDownVelocityAboveMin_collapsesBouncer() { when(mFlingAnimationUtils.getMinVelocityPxPerSecond()).thenReturn((float) 0); // The swipe amount above the set expansion threshold is ignored. final float swipeUpPercentage = .7f; swipeToPosition(swipeUpPercentage, 1); final float expansion = 1 - swipeUpPercentage; final float velocityY = 1; swipeToPosition(swipeUpPercentage, velocityY); verify(mValueAnimatorCreator).create(eq(expansion), eq(KeyguardBouncer.EXPANSION_HIDDEN)); verify(mFlingAnimationUtilsClosing).apply(eq(mValueAnimator), eq(SCREEN_HEIGHT_PX * expansion), eq(SCREEN_HEIGHT_PX * KeyguardBouncer.EXPANSION_HIDDEN), eq(velocityY), eq((float) SCREEN_HEIGHT_PX)); verify(mValueAnimator).start(); } /** * Tests that swiping up with a speed above the set threshold will continue the expansion. */ @Test public void testSwipeUpVelocityAboveMin_expandsBouncer() { when(mFlingAnimationUtils.getMinVelocityPxPerSecond()).thenReturn((float) 0); verify(mValueAnimatorCreator).create(eq(1 - swipeUpPercentage), eq(KeyguardBouncer.EXPANSION_HIDDEN)); verify(mFlingAnimationUtils).apply(eq(mValueAnimator), anyFloat(), anyFloat(), anyFloat(), anyFloat()); // The swipe amount below the set expansion threshold is ignored. final float swipeUpPercentage = .3f; final float expansion = 1 - swipeUpPercentage; final float velocityY = -1; swipeToPosition(swipeUpPercentage, velocityY); verify(mValueAnimatorCreator).create(eq(expansion), eq(KeyguardBouncer.EXPANSION_VISIBLE)); verify(mFlingAnimationUtils).apply(eq(mValueAnimator), eq(SCREEN_HEIGHT_PX * expansion), eq(SCREEN_HEIGHT_PX * KeyguardBouncer.EXPANSION_VISIBLE), eq(velocityY), eq((float) SCREEN_HEIGHT_PX)); verify(mValueAnimator).start(); } }