diff options
| author | 2024-09-30 22:57:36 +0000 | |
|---|---|---|
| committer | 2024-09-30 22:57:36 +0000 | |
| commit | 40df1d1b762506527cdd12815f90a4c3c5ff3af3 (patch) | |
| tree | 972ae3abc676cd4ca0c8324d623098fd6af8d52d | |
| parent | 7cc648a95219e30106ab9772a276691a5f3d0ba2 (diff) | |
| parent | 78c41067a1cac88f18aadcb47ff19639098d9572 (diff) | |
Merge "Opening type changes need alpha=1 when PiPing" into main
| -rw-r--r-- | libs/WindowManager/Shell/src/com/android/wm/shell/pip2/phone/PipTransition.java | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/pip2/phone/PipTransition.java b/libs/WindowManager/Shell/src/com/android/wm/shell/pip2/phone/PipTransition.java index f93233ec7461..1b9bf2acbb96 100644 --- a/libs/WindowManager/Shell/src/com/android/wm/shell/pip2/phone/PipTransition.java +++ b/libs/WindowManager/Shell/src/com/android/wm/shell/pip2/phone/PipTransition.java @@ -54,6 +54,7 @@ import com.android.wm.shell.common.pip.PipUtils; import com.android.wm.shell.pip.PipTransitionController; import com.android.wm.shell.pip2.animation.PipAlphaAnimator; import com.android.wm.shell.pip2.animation.PipEnterExitAnimator; +import com.android.wm.shell.shared.TransitionUtil; import com.android.wm.shell.shared.pip.PipContentOverlay; import com.android.wm.shell.sysui.ShellInit; import com.android.wm.shell.transition.Transitions; @@ -405,6 +406,18 @@ public class PipTransition extends PipTransitionController implements sourceRectHint = pipChange.getTaskInfo().pictureInPictureParams.getSourceRectHint(); } + // For opening type transitions, if there is a non-pip change of mode TO_FRONT/OPEN, + // make sure that change has alpha of 1f, since it's init state might be set to alpha=0f + // by the Transitions framework to simplify Task opening transitions. + if (TransitionUtil.isOpeningType(info.getType())) { + for (TransitionInfo.Change change : info.getChanges()) { + if (change.getLeash() == null || change == pipChange) continue; + if (change.getMode() == TRANSIT_OPEN || change.getMode() == TRANSIT_TO_FRONT) { + startTransaction.setAlpha(change.getLeash(), 1f); + } + } + } + PipEnterExitAnimator animator = new PipEnterExitAnimator(mContext, pipLeash, startTransaction, finishTransaction, startBounds, startBounds, endBounds, sourceRectHint, PipEnterExitAnimator.BOUNDS_ENTER, Surface.ROTATION_0); |