Loading packages/SystemUI/src/com/android/systemui/media/controls/ui/MediaHierarchyManager.kt +5 −2 Original line number Diff line number Diff line Loading @@ -317,13 +317,16 @@ constructor( /** * Returns the amount of translationY of the media container, during the current guided * transformation, if running. If there is no guided transformation running, it will return 0. * transformation, if running. If there is no guided transformation running, it will return -1. */ fun getGuidedTransformationTranslationY(): Int { if (!isCurrentlyInGuidedTransformation()) { return -1 } val startHost = getHost(previousLocation) ?: return 0 val startHost = getHost(previousLocation) if (startHost == null || !startHost.visible) { return 0 } return targetBounds.top - startHost.currentBounds.top } Loading packages/SystemUI/tests/src/com/android/systemui/media/controls/ui/MediaHierarchyManagerTest.kt +9 −0 Original line number Diff line number Diff line Loading @@ -388,6 +388,15 @@ class MediaHierarchyManagerTest : SysuiTestCase() { .isEqualTo(expectedTranslation) } @Test fun getGuidedTransformationTranslationY_previousHostInvisible_returnsZero() { goToLockscreen() enterGuidedTransformation() whenever(lockHost.visible).thenReturn(false) assertThat(mediaHierarchyManager.getGuidedTransformationTranslationY()).isEqualTo(0) } @Test fun isCurrentlyInGuidedTransformation_hostsVisible_returnsTrue() { goToLockscreen() Loading Loading
packages/SystemUI/src/com/android/systemui/media/controls/ui/MediaHierarchyManager.kt +5 −2 Original line number Diff line number Diff line Loading @@ -317,13 +317,16 @@ constructor( /** * Returns the amount of translationY of the media container, during the current guided * transformation, if running. If there is no guided transformation running, it will return 0. * transformation, if running. If there is no guided transformation running, it will return -1. */ fun getGuidedTransformationTranslationY(): Int { if (!isCurrentlyInGuidedTransformation()) { return -1 } val startHost = getHost(previousLocation) ?: return 0 val startHost = getHost(previousLocation) if (startHost == null || !startHost.visible) { return 0 } return targetBounds.top - startHost.currentBounds.top } Loading
packages/SystemUI/tests/src/com/android/systemui/media/controls/ui/MediaHierarchyManagerTest.kt +9 −0 Original line number Diff line number Diff line Loading @@ -388,6 +388,15 @@ class MediaHierarchyManagerTest : SysuiTestCase() { .isEqualTo(expectedTranslation) } @Test fun getGuidedTransformationTranslationY_previousHostInvisible_returnsZero() { goToLockscreen() enterGuidedTransformation() whenever(lockHost.visible).thenReturn(false) assertThat(mediaHierarchyManager.getGuidedTransformationTranslationY()).isEqualTo(0) } @Test fun isCurrentlyInGuidedTransformation_hostsVisible_returnsTrue() { goToLockscreen() Loading