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

Commit 9fe13742 authored by Liran Binyamin's avatar Liran Binyamin
Browse files

Add remaining split drag zones to DragZoneFactory

Change-Id: I2053262fdf50b41a9e4bbce4020c62d35d5e55ed
Flag: EXEMPT not wired
Test: atest DragZoneFactory
Bug: 393172431
parent 03cab7ec
Loading
Loading
Loading
Loading
+28 −8
Original line number Original line Diff line number Diff line
@@ -44,8 +44,8 @@ class DragZoneFactory(
    private val hSplitFromExpandedViewDragZoneWidth = 60
    private val hSplitFromExpandedViewDragZoneWidth = 60
    private val vSplitFromExpandedViewDragZoneWidth = 200
    private val vSplitFromExpandedViewDragZoneWidth = 200
    private val vSplitFromExpandedViewDragZoneHeightTablet = 285
    private val vSplitFromExpandedViewDragZoneHeightTablet = 285
    private val vSplitFromExpandedViewDragZoneHeightFold = 150
    private val vSplitFromExpandedViewDragZoneHeightFoldTall = 150
    private val vUnevenSplitFromExpandedViewDragZoneHeight = 96
    private val vSplitFromExpandedViewDragZoneHeightFoldShort = 100


    /**
    /**
     * Creates the list of drag zones for the dragged object.
     * Creates the list of drag zones for the dragged object.
@@ -360,7 +360,7 @@ class DragZoneFactory(
                                    fullScreenDragZoneHeight,
                                    fullScreenDragZoneHeight,
                                    splitZoneLeft + fullScreenDragZoneWidth,
                                    splitZoneLeft + fullScreenDragZoneWidth,
                                    fullScreenDragZoneHeight +
                                    fullScreenDragZoneHeight +
                                        vSplitFromExpandedViewDragZoneHeightFold
                                        vSplitFromExpandedViewDragZoneHeightFoldTall
                                ),
                                ),
                        ),
                        ),
                        DragZone.Split.Bottom(
                        DragZone.Split.Bottom(
@@ -370,12 +370,32 @@ class DragZoneFactory(
                                    windowBounds.bottom / 2,
                                    windowBounds.bottom / 2,
                                    splitZoneLeft + fullScreenDragZoneWidth,
                                    splitZoneLeft + fullScreenDragZoneWidth,
                                    windowBounds.bottom / 2 +
                                    windowBounds.bottom / 2 +
                                        vSplitFromExpandedViewDragZoneHeightFold
                                        vSplitFromExpandedViewDragZoneHeightFoldTall
                                ),
                        )
                    )
                SplitScreenMode.SPLIT_10_90 ->
                    listOf(
                        DragZone.Split.Top(
                            bounds =
                                Rect(
                                    0,
                                    0,
                                    windowBounds.right,
                                    vSplitFromExpandedViewDragZoneHeightFoldShort
                                ),
                        ),
                        DragZone.Split.Bottom(
                            bounds =
                                Rect(
                                    splitZoneLeft,
                                    vSplitFromExpandedViewDragZoneHeightFoldShort,
                                    splitZoneLeft + fullScreenDragZoneWidth,
                                    vSplitFromExpandedViewDragZoneHeightFoldShort +
                                        vSplitFromExpandedViewDragZoneHeightFoldTall
                                ),
                                ),
                        )
                        )
                    )
                    )
                // TODO b/393172431: add this zone when it's defined
                SplitScreenMode.SPLIT_10_90 -> listOf()
                SplitScreenMode.SPLIT_90_10 ->
                SplitScreenMode.SPLIT_90_10 ->
                    listOf(
                    listOf(
                        DragZone.Split.Top(
                        DragZone.Split.Top(
@@ -385,7 +405,7 @@ class DragZoneFactory(
                                    fullScreenDragZoneHeight,
                                    fullScreenDragZoneHeight,
                                    splitZoneLeft + fullScreenDragZoneWidth,
                                    splitZoneLeft + fullScreenDragZoneWidth,
                                    fullScreenDragZoneHeight +
                                    fullScreenDragZoneHeight +
                                        vUnevenSplitFromExpandedViewDragZoneHeight
                                        vSplitFromExpandedViewDragZoneHeightFoldTall
                                ),
                                ),
                        ),
                        ),
                        DragZone.Split.Bottom(
                        DragZone.Split.Bottom(
@@ -393,7 +413,7 @@ class DragZoneFactory(
                                Rect(
                                Rect(
                                    0,
                                    0,
                                    windowBounds.bottom -
                                    windowBounds.bottom -
                                        vUnevenSplitFromExpandedViewDragZoneHeight,
                                        vSplitFromExpandedViewDragZoneHeightFoldShort,
                                    windowBounds.right,
                                    windowBounds.right,
                                    windowBounds.bottom
                                    windowBounds.bottom
                                ),
                                ),