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

Commit eaa90ee7 authored by Evan Rosky's avatar Evan Rosky
Browse files

Fallback to endRelOffset for activity surface offsets

We intentionally report incorrect information about activity
bounds to shell for letterbox situations. Until we resolve the
root issue, use endRelOffset as a fallback to keep app-compat
activities from animating in the wrong location.

Bug: 332690307
Test: go activity->activity with letterboxed activities.
Change-Id: I88146b4f8858ee846956b27d3706e719076a4e8c
parent 2830e96f
Loading
Loading
Loading
Loading
+9 −0
Original line number Diff line number Diff line
@@ -507,6 +507,15 @@ public class DefaultTransitionHandler implements Transitions.TransitionHandler {
                final Point animRelOffset = new Point(
                        change.getEndAbsBounds().left - animRoot.getOffset().x,
                        change.getEndAbsBounds().top - animRoot.getOffset().y);

                if (change.getActivityComponent() != null) {
                    // For appcompat letterbox: we intentionally report the task-bounds so that we
                    // can animate as-if letterboxes are "part of" the activity. This means we can't
                    // always rely solely on endAbsBounds and need to also max with endRelOffset.
                    animRelOffset.x = Math.max(animRelOffset.x, change.getEndRelOffset().x);
                    animRelOffset.y = Math.max(animRelOffset.y, change.getEndRelOffset().y);
                }

                if (change.getActivityComponent() != null && !isActivityLevel) {
                    // At this point, this is an independent activity change in a non-activity
                    // transition. This means that an activity transition got erroneously combined