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

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

Merge "Support refactored Region class"

parents 675a2209 b03abbe0
Loading
Loading
Loading
Loading
+4 −4
Original line number Diff line number Diff line
@@ -118,10 +118,10 @@ fun FlickerTestParameter.dockedStackSecondaryBoundsIsVisibleAtEnd(
fun getPrimaryRegion(dividerRegion: Region, rotation: Int): Region {
    val displayBounds = WindowUtils.getDisplayBounds(rotation)
    return if (rotation == Surface.ROTATION_0 || rotation == Surface.ROTATION_180) {
        Region(0, 0, displayBounds.bounds.right,
        Region.from(0, 0, displayBounds.bounds.right,
            dividerRegion.bounds.top + WindowUtils.dockedStackDividerInset)
    } else {
        Region(0, 0, dividerRegion.bounds.left + WindowUtils.dockedStackDividerInset,
        Region.from(0, 0, dividerRegion.bounds.left + WindowUtils.dockedStackDividerInset,
            displayBounds.bounds.bottom)
    }
}
@@ -129,10 +129,10 @@ fun getPrimaryRegion(dividerRegion: Region, rotation: Int): Region {
fun getSecondaryRegion(dividerRegion: Region, rotation: Int): Region {
    val displayBounds = WindowUtils.getDisplayBounds(rotation)
    return if (rotation == Surface.ROTATION_0 || rotation == Surface.ROTATION_180) {
        Region(0, dividerRegion.bounds.bottom - WindowUtils.dockedStackDividerInset,
        Region.from(0, dividerRegion.bounds.bottom - WindowUtils.dockedStackDividerInset,
            displayBounds.bounds.right, displayBounds.bounds.bottom)
    } else {
        Region(dividerRegion.bounds.right - WindowUtils.dockedStackDividerInset, 0,
        Region.from(dividerRegion.bounds.right - WindowUtils.dockedStackDividerInset, 0,
            displayBounds.bounds.right, displayBounds.bounds.bottom)
    }
}
 No newline at end of file
+2 −2
Original line number Diff line number Diff line
@@ -28,14 +28,14 @@ class AppPairsHelper(
    component: FlickerComponentName
) : BaseAppHelper(instrumentation, activityLabel, component) {
    fun getPrimaryBounds(dividerBounds: Region): Region {
        val primaryAppBounds = Region(0, 0, dividerBounds.bounds.right,
        val primaryAppBounds = Region.from(0, 0, dividerBounds.bounds.right,
                dividerBounds.bounds.bottom + WindowUtils.dockedStackDividerInset)
        return primaryAppBounds
    }

    fun getSecondaryBounds(dividerBounds: Region): Region {
        val displayBounds = WindowUtils.displayBounds
        val secondaryAppBounds = Region(0,
        val secondaryAppBounds = Region.from(0,
                dividerBounds.bounds.bottom - WindowUtils.dockedStackDividerInset,
                displayBounds.right, displayBounds.bottom - WindowUtils.navigationBarHeight)
        return secondaryAppBounds
+4 −4
Original line number Diff line number Diff line
@@ -166,9 +166,9 @@ class ResizeLegacySplitScreen(
            val dividerBounds =
                layer(DOCKED_STACK_DIVIDER_COMPONENT).visibleRegion.region.bounds

            val topAppBounds = Region(0, 0, dividerBounds.right,
            val topAppBounds = Region.from(0, 0, dividerBounds.right,
                dividerBounds.top + WindowUtils.dockedStackDividerInset)
            val bottomAppBounds = Region(0,
            val bottomAppBounds = Region.from(0,
                dividerBounds.bottom - WindowUtils.dockedStackDividerInset,
                displayBounds.right,
                displayBounds.bottom - WindowUtils.navigationBarHeight)
@@ -187,9 +187,9 @@ class ResizeLegacySplitScreen(
            val dividerBounds =
                layer(DOCKED_STACK_DIVIDER_COMPONENT).visibleRegion.region.bounds

            val topAppBounds = Region(0, 0, dividerBounds.right,
            val topAppBounds = Region.from(0, 0, dividerBounds.right,
                dividerBounds.top + WindowUtils.dockedStackDividerInset)
            val bottomAppBounds = Region(0,
            val bottomAppBounds = Region.from(0,
                dividerBounds.bottom - WindowUtils.dockedStackDividerInset,
                displayBounds.right,
                displayBounds.bottom - WindowUtils.navigationBarHeight)