diff options
2 files changed, 14 insertions, 0 deletions
diff --git a/packages/SystemUI/multivalentTests/src/com/android/systemui/statusbar/notification/stack/MagneticNotificationRowManagerImplTest.kt b/packages/SystemUI/multivalentTests/src/com/android/systemui/statusbar/notification/stack/MagneticNotificationRowManagerImplTest.kt index 6c6ba933c03a..936b971c889b 100644 --- a/packages/SystemUI/multivalentTests/src/com/android/systemui/statusbar/notification/stack/MagneticNotificationRowManagerImplTest.kt +++ b/packages/SystemUI/multivalentTests/src/com/android/systemui/statusbar/notification/stack/MagneticNotificationRowManagerImplTest.kt @@ -248,6 +248,19 @@ class MagneticNotificationRowManagerImplTest : SysuiTestCase() { } @Test + fun onMagneticInteractionEnd_whileTargetsSet_goesToIdle() = + kosmos.testScope.runTest { + // GIVEN that targets are set + setTargets() + + // WHEN the interaction ends on the row + underTest.onMagneticInteractionEnd(swipedRow, velocity = null) + + // THEN the state resets + assertThat(underTest.currentState).isEqualTo(State.IDLE) + } + + @Test fun onMagneticInteractionEnd_whileDetached_goesToIdle() = kosmos.testScope.runTest { // GIVEN the swiped row is detached diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/MagneticNotificationRowManagerImpl.kt b/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/MagneticNotificationRowManagerImpl.kt index 6e8b2226b4f6..7d489a97f853 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/MagneticNotificationRowManagerImpl.kt +++ b/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/MagneticNotificationRowManagerImpl.kt @@ -270,6 +270,7 @@ constructor( translationOffset = 0f if (row.isSwipedTarget()) { when (currentState) { + State.TARGETS_SET -> currentState = State.IDLE State.PULLING -> { snapNeighborsBack(velocity) currentState = State.IDLE |