Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 29728672 authored by Treehugger Robot's avatar Treehugger Robot Committed by Android (Google) Code Review
Browse files

Merge "[flexiglass] Don't expand other dual shade when swiping in this one" into main

parents 2ba3a051 f77b0177
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -76,7 +76,7 @@ class NotificationsShadeOverlayActionsViewModelTest : SysuiTestCase() {
            underTest.activateIn(this)

            val action =
                (actions?.get(Swipe.Down(fromSource = SceneContainerArea.EndHalf))
                (actions?.get(Swipe.Down(fromSource = SceneContainerArea.TopEdgeEndHalf))
                    as? ReplaceByOverlay)
            assertThat(action?.overlay).isEqualTo(Overlays.QuickSettingsShade)
        }
+1 −1
Original line number Diff line number Diff line
@@ -89,7 +89,7 @@ class QuickSettingsShadeOverlayActionsViewModelTest : SysuiTestCase() {
            underTest.activateIn(this)

            val action =
                (actions?.get(Swipe.Down(fromSource = SceneContainerArea.StartHalf))
                (actions?.get(Swipe.Down(fromSource = SceneContainerArea.TopEdgeStartHalf))
                    as? ReplaceByOverlay)
            assertThat(action?.overlay).isEqualTo(Overlays.NotificationsShade)
        }
+19 −5
Original line number Diff line number Diff line
@@ -32,6 +32,8 @@ import com.android.systemui.scene.ui.viewmodel.SceneContainerArea.Resolved.LeftE
import com.android.systemui.scene.ui.viewmodel.SceneContainerArea.Resolved.LeftHalf
import com.android.systemui.scene.ui.viewmodel.SceneContainerArea.Resolved.RightEdge
import com.android.systemui.scene.ui.viewmodel.SceneContainerArea.Resolved.RightHalf
import com.android.systemui.scene.ui.viewmodel.SceneContainerArea.Resolved.TopEdgeLeftHalf
import com.android.systemui.scene.ui.viewmodel.SceneContainerArea.Resolved.TopEdgeRightHalf
import com.android.systemui.scene.ui.viewmodel.SceneContainerArea.StartEdge
import com.android.systemui.scene.ui.viewmodel.SceneContainerArea.StartHalf
import com.google.common.truth.Truth.assertThat
@@ -55,9 +57,9 @@ class SceneContainerSwipeDetectorTest : SysuiTestCase() {
    }

    @Test
    fun source_swipeVerticallyOnTopLeft_detectsLeftHalf() {
    fun source_swipeVerticallyOnTopLeft_detectsTopEdgeLeftHalf() {
        val detectedEdge = swipeVerticallyFrom(x = 1, y = edgeSize - 1)
        assertThat(detectedEdge).isEqualTo(LeftHalf)
        assertThat(detectedEdge).isEqualTo(TopEdgeLeftHalf)
    }

    @Test
@@ -69,7 +71,7 @@ class SceneContainerSwipeDetectorTest : SysuiTestCase() {
    @Test
    fun source_swipeVerticallyOnTopRight_detectsRightHalf() {
        val detectedEdge = swipeVerticallyFrom(x = screenWidth - 1, y = edgeSize - 1)
        assertThat(detectedEdge).isEqualTo(RightHalf)
        assertThat(detectedEdge).isEqualTo(TopEdgeRightHalf)
    }

    @Test
@@ -79,14 +81,26 @@ class SceneContainerSwipeDetectorTest : SysuiTestCase() {
    }

    @Test
    fun source_swipeVerticallyToLeftOfSplit_detectsLeftHalf() {
    fun source_swipeVerticallyOnTopEdge_ToLeftOfSplit_detectsTopEdgeLeftHalf() {
        val detectedEdge = swipeVerticallyFrom(x = (screenWidth / 2) - 1, y = edgeSize - 1)
        assertThat(detectedEdge).isEqualTo(TopEdgeLeftHalf)
    }

    @Test
    fun source_swipeVerticallyBelowTopEdge_ToLeftOfSplit_detectsLeftHalf() {
        val detectedEdge = swipeVerticallyFrom(x = (screenWidth / 2) - 1, y = edgeSize + 1)
        assertThat(detectedEdge).isEqualTo(LeftHalf)
    }

    @Test
    fun source_swipeVerticallyToRightOfSplit_detectsRightHalf() {
    fun source_swipeVerticallyOnTopEdge_toRightOfSplit_detectsTopEdgeRightHalf() {
        val detectedEdge = swipeVerticallyFrom(x = (screenWidth / 2) + 1, y = edgeSize - 1)
        assertThat(detectedEdge).isEqualTo(TopEdgeRightHalf)
    }

    @Test
    fun source_swipeVerticallyBelowTopEdge_toRightOfSplit_detectsRightHalf() {
        val detectedEdge = swipeVerticallyFrom(x = (screenWidth / 2) + 1, y = edgeSize + 1)
        assertThat(detectedEdge).isEqualTo(RightHalf)
    }

+1 −1
Original line number Diff line number Diff line
@@ -37,7 +37,7 @@ class NotificationsShadeOverlayActionsViewModel @AssistedInject constructor() :
            mapOf(
                Swipe.Up to HideOverlay(Overlays.NotificationsShade),
                Back to HideOverlay(Overlays.NotificationsShade),
                Swipe.Down(fromSource = SceneContainerArea.EndHalf) to
                Swipe.Down(fromSource = SceneContainerArea.TopEdgeEndHalf) to
                    ReplaceByOverlay(Overlays.QuickSettingsShade),
            )
        )
+1 −1
Original line number Diff line number Diff line
@@ -46,7 +46,7 @@ constructor(private val editModeViewModel: EditModeViewModel) : UserActionsViewM
                        put(Back, HideOverlay(Overlays.QuickSettingsShade))
                    }
                    put(
                        Swipe.Down(fromSource = SceneContainerArea.StartHalf),
                        Swipe.Down(fromSource = SceneContainerArea.TopEdgeStartHalf),
                        ReplaceByOverlay(Overlays.NotificationsShade),
                    )
                }
Loading