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

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

Merge "Rotate splitscreen drawable by 90 when splitscreen is vertical." into main

parents 006c22a5 0cdefc74
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -484,6 +484,7 @@ public class DesktopModeWindowDecoration extends WindowDecoration<WindowDecorLin
        if (isHandleMenuActive()) {
            mHandleMenu.relayout(
                    startT,
                    taskInfo.configuration,
                    mResult.mCaptionX,
                    // Add top padding to the caption Y so that the menu is shown over what is the
                    // actual contents of the caption, ignoring padding. This is currently relevant
+25 −1
Original line number Diff line number Diff line
@@ -23,6 +23,7 @@ import android.app.WindowConfiguration
import android.content.Context
import android.content.Intent
import android.content.res.ColorStateList
import android.content.res.Configuration
import android.content.res.Resources
import android.graphics.Bitmap
import android.graphics.PixelFormat
@@ -57,6 +58,7 @@ import androidx.core.view.accessibility.AccessibilityNodeInfoCompat.Accessibilit
import androidx.core.view.isGone
import com.android.window.flags.Flags
import com.android.wm.shell.R
import com.android.wm.shell.common.split.SplitScreenUtils
import com.android.wm.shell.desktopmode.DesktopModeUiEventLogger
import com.android.wm.shell.desktopmode.DesktopModeUiEventLogger.DesktopUiEventEnum.A11Y_APP_HANDLE_MENU_DESKTOP_VIEW
import com.android.wm.shell.desktopmode.DesktopModeUiEventLogger.DesktopUiEventEnum.A11Y_APP_HANDLE_MENU_FULLSCREEN
@@ -387,10 +389,16 @@ private constructor(
    }

    /** Update pill layout, in case task changes have caused positioning to change. */
    fun relayout(t: SurfaceControl.Transaction, captionX: Int, captionY: Int) {
    fun relayout(
        t: SurfaceControl.Transaction,
        configuration: Configuration,
        captionX: Int,
        captionY: Int,
    ) {
        handleMenuViewContainer?.let { container ->
            updateHandleMenuPillPositions(captionX, captionY)
            container.setPosition(t, handleMenuPosition.x, handleMenuPosition.y)
            handleMenuView?.updateSplitScreenButtonOrientation(configuration)
        }
    }

@@ -947,6 +955,7 @@ private constructor(
                        drawableInsets = iconButtonDrawableInsetsBase,
                    )
            }
            updateSplitScreenButtonOrientation(taskInfo.configuration)

            floatingBtn.apply {
                background =
@@ -967,6 +976,21 @@ private constructor(
            }
        }

        /** Update the split screen button (horizontal vs. vertical split) orientation. */
        fun updateSplitScreenButtonOrientation(configuration: Configuration) {
            splitscreenBtn.rotation =
                if (
                    SplitScreenUtils.isLeftRightSplit(
                        SplitScreenUtils.allowLeftRightSplitInPortrait(context.resources),
                        configuration,
                    )
                ) {
                    0f
                } else {
                    90f
                }
        }

        private fun bindMoreActionsPill(style: MenuStyle) {
            moreActionsPill.background.setTint(style.backgroundColor)
            val buttons =
+6 −1
Original line number Diff line number Diff line
@@ -186,7 +186,12 @@ class AppHandleController(
                    wct,
                )

            handleMenu?.relayout(startT, captionLayout.captionX, captionLayout.captionY)
            handleMenu?.relayout(
                startT,
                taskInfo.configuration,
                captionLayout.captionX,
                captionLayout.captionY,
            )
            openByDefaultDialog?.relayout(taskInfo)

            updateViewHolder(captionLayout)
+1 −0
Original line number Diff line number Diff line
@@ -223,6 +223,7 @@ class AppHeaderController(
                )
            handleMenu?.relayout(
                startT,
                taskInfo.configuration,
                captionLayout.captionX,
                // Add top padding to the caption Y so that the menu is shown over what is the
                // actual contents of the caption, ignoring padding. This is currently relevant