Loading packages/SystemUI/multivalentTests/src/com/android/systemui/statusbar/notification/stack/MagneticNotificationRowManagerImplTest.kt +5 −5 Original line number Diff line number Diff line Loading @@ -139,7 +139,7 @@ class MagneticNotificationRowManagerImplTest : SysuiTestCase() { underTest.setMagneticRowTranslation(swipedRow, translation = 100f) // WHEN setting a translation that will fall below the threshold val translation = threshold / underTest.swipedRowMultiplier - 50f val translation = 50f underTest.setMagneticRowTranslation(swipedRow, translation) // THEN the targets continue to be pulled and translations are set Loading @@ -162,7 +162,7 @@ class MagneticNotificationRowManagerImplTest : SysuiTestCase() { underTest.setMagneticRowTranslation(swipedRow, translation = 100f) // WHEN setting a translation that will fall below the threshold val translation = threshold / underTest.swipedRowMultiplier - 50f val translation = 50f underTest.setMagneticRowTranslation(swipedRow, translation) // THEN the targets continue to be pulled and reduced translations are set Loading @@ -185,7 +185,7 @@ class MagneticNotificationRowManagerImplTest : SysuiTestCase() { underTest.setMagneticRowTranslation(swipedRow, translation = 100f) // WHEN setting a translation that will fall above the threshold val translation = threshold / underTest.swipedRowMultiplier + 50f val translation = 150f underTest.setMagneticRowTranslation(swipedRow, translation) // THEN the swiped view detaches and the correct detach haptics play Loading @@ -208,7 +208,7 @@ class MagneticNotificationRowManagerImplTest : SysuiTestCase() { underTest.setMagneticRowTranslation(swipedRow, translation = 100f) // WHEN setting a translation that will fall above the threshold val translation = threshold / underTest.swipedRowMultiplier + 50f val translation = 150f underTest.setMagneticRowTranslation(swipedRow, translation) // THEN the swiped view does not detach and the reduced translation is set Loading Loading @@ -355,7 +355,7 @@ class MagneticNotificationRowManagerImplTest : SysuiTestCase() { underTest.setMagneticRowTranslation(swipedRow, translation = 100f) // Set a translation that will fall above the threshold val translation = threshold / underTest.swipedRowMultiplier + 50f val translation = 150f underTest.setMagneticRowTranslation(swipedRow, translation) assertThat(underTest.currentState).isEqualTo(State.DETACHED) Loading packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/MagneticNotificationRowManagerImpl.kt +2 −4 Original line number Diff line number Diff line Loading @@ -169,8 +169,7 @@ constructor( } private fun pullDismissibleRow(translation: Float) { val targetTranslation = swipedRowMultiplier * translation val crossedThreshold = abs(targetTranslation) >= magneticDetachThreshold val crossedThreshold = abs(translation) >= magneticDetachThreshold if (crossedThreshold) { snapNeighborsBack() currentMagneticListeners.swipedListener()?.let { detach(it, translation) } Loading Loading @@ -247,8 +246,7 @@ constructor( } private fun translateDetachedRow(translation: Float) { val targetTranslation = swipedRowMultiplier * translation val crossedThreshold = abs(targetTranslation) <= magneticAttachThreshold val crossedThreshold = abs(translation) <= magneticAttachThreshold if (crossedThreshold) { translationOffset += translation updateRoundness(translation = 0f, animate = true) Loading Loading
packages/SystemUI/multivalentTests/src/com/android/systemui/statusbar/notification/stack/MagneticNotificationRowManagerImplTest.kt +5 −5 Original line number Diff line number Diff line Loading @@ -139,7 +139,7 @@ class MagneticNotificationRowManagerImplTest : SysuiTestCase() { underTest.setMagneticRowTranslation(swipedRow, translation = 100f) // WHEN setting a translation that will fall below the threshold val translation = threshold / underTest.swipedRowMultiplier - 50f val translation = 50f underTest.setMagneticRowTranslation(swipedRow, translation) // THEN the targets continue to be pulled and translations are set Loading @@ -162,7 +162,7 @@ class MagneticNotificationRowManagerImplTest : SysuiTestCase() { underTest.setMagneticRowTranslation(swipedRow, translation = 100f) // WHEN setting a translation that will fall below the threshold val translation = threshold / underTest.swipedRowMultiplier - 50f val translation = 50f underTest.setMagneticRowTranslation(swipedRow, translation) // THEN the targets continue to be pulled and reduced translations are set Loading @@ -185,7 +185,7 @@ class MagneticNotificationRowManagerImplTest : SysuiTestCase() { underTest.setMagneticRowTranslation(swipedRow, translation = 100f) // WHEN setting a translation that will fall above the threshold val translation = threshold / underTest.swipedRowMultiplier + 50f val translation = 150f underTest.setMagneticRowTranslation(swipedRow, translation) // THEN the swiped view detaches and the correct detach haptics play Loading @@ -208,7 +208,7 @@ class MagneticNotificationRowManagerImplTest : SysuiTestCase() { underTest.setMagneticRowTranslation(swipedRow, translation = 100f) // WHEN setting a translation that will fall above the threshold val translation = threshold / underTest.swipedRowMultiplier + 50f val translation = 150f underTest.setMagneticRowTranslation(swipedRow, translation) // THEN the swiped view does not detach and the reduced translation is set Loading Loading @@ -355,7 +355,7 @@ class MagneticNotificationRowManagerImplTest : SysuiTestCase() { underTest.setMagneticRowTranslation(swipedRow, translation = 100f) // Set a translation that will fall above the threshold val translation = threshold / underTest.swipedRowMultiplier + 50f val translation = 150f underTest.setMagneticRowTranslation(swipedRow, translation) assertThat(underTest.currentState).isEqualTo(State.DETACHED) Loading
packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/MagneticNotificationRowManagerImpl.kt +2 −4 Original line number Diff line number Diff line Loading @@ -169,8 +169,7 @@ constructor( } private fun pullDismissibleRow(translation: Float) { val targetTranslation = swipedRowMultiplier * translation val crossedThreshold = abs(targetTranslation) >= magneticDetachThreshold val crossedThreshold = abs(translation) >= magneticDetachThreshold if (crossedThreshold) { snapNeighborsBack() currentMagneticListeners.swipedListener()?.let { detach(it, translation) } Loading Loading @@ -247,8 +246,7 @@ constructor( } private fun translateDetachedRow(translation: Float) { val targetTranslation = swipedRowMultiplier * translation val crossedThreshold = abs(targetTranslation) <= magneticAttachThreshold val crossedThreshold = abs(translation) <= magneticAttachThreshold if (crossedThreshold) { translationOffset += translation updateRoundness(translation = 0f, animate = true) Loading