Loading packages/SystemUI/animation/src/com/android/systemui/animation/DialogTransitionAnimator.kt +20 −3 Original line number Diff line number Diff line Loading @@ -944,10 +944,27 @@ private class AnimatedDialog( } override fun onTransitionAnimationEnd(isExpandingFullyAbove: Boolean) { // onLaunchAnimationEnd is called by an Animator at the end of the animation, // on a Choreographer animation tick. The following calls will move the animated // content from the dialog overlay back to its original position, and this // change must be reflected in the next frame given that we then sync the next // frame of both the content and dialog ViewRoots. However, in case that content // is rendered by Compose, whose compositions are also scheduled on a // Choreographer frame, any state change made *right now* won't be reflected in // the next frame given that a Choreographer frame can't schedule another and // have it happen in the same frame. So we post the forwarded calls to // [Controller.onLaunchAnimationEnd], leaving this Choreographer frame, ensuring // that the move of the content back to its original window will be reflected in // the next frame right after [onLaunchAnimationEnd] is called. // // TODO(b/330672236): Move this to TransitionAnimator. dialog.context.mainExecutor.execute { startController.onTransitionAnimationEnd(isExpandingFullyAbove) endController.onTransitionAnimationEnd(isExpandingFullyAbove) onLaunchAnimationEnd() } } override fun onTransitionAnimationProgress( state: TransitionAnimator.State, Loading packages/SystemUI/animation/src/com/android/systemui/animation/TransitionAnimator.kt +7 −20 Original line number Diff line number Diff line Loading @@ -379,20 +379,8 @@ class TransitionAnimator( Log.d(TAG, "Animation ended") } // onAnimationEnd is called at the end of the animation, on a Choreographer // animation tick. During dialog launches, the following calls will move the // animated content from the dialog overlay back to its original position, and // this change must be reflected in the next frame given that we then sync the // next frame of both the content and dialog ViewRoots. During SysUI activity // launches, we will instantly collapse the shade at the end of the transition. // However, if those are rendered by Compose, whose compositions are also // scheduled on a Choreographer frame, any state change made *right now* won't // be reflected in the next frame given that a Choreographer frame can't // schedule another and have it happen in the same frame. So we post the // forwarded calls to [Controller.onLaunchAnimationEnd] in the main executor, // leaving this Choreographer frame, ensuring that any state change applied by // onTransitionAnimationEnd() will be reflected in the same frame. mainExecutor.execute { // TODO(b/330672236): Post this to the main thread instead so that it does not // flicker with Flexiglass enabled. controller.onTransitionAnimationEnd(isExpandingFullyAbove) transitionContainerOverlay.remove(windowBackgroundLayer) Loading @@ -401,7 +389,6 @@ class TransitionAnimator( } } } } ) animator.addUpdateListener { animation -> Loading Loading
packages/SystemUI/animation/src/com/android/systemui/animation/DialogTransitionAnimator.kt +20 −3 Original line number Diff line number Diff line Loading @@ -944,10 +944,27 @@ private class AnimatedDialog( } override fun onTransitionAnimationEnd(isExpandingFullyAbove: Boolean) { // onLaunchAnimationEnd is called by an Animator at the end of the animation, // on a Choreographer animation tick. The following calls will move the animated // content from the dialog overlay back to its original position, and this // change must be reflected in the next frame given that we then sync the next // frame of both the content and dialog ViewRoots. However, in case that content // is rendered by Compose, whose compositions are also scheduled on a // Choreographer frame, any state change made *right now* won't be reflected in // the next frame given that a Choreographer frame can't schedule another and // have it happen in the same frame. So we post the forwarded calls to // [Controller.onLaunchAnimationEnd], leaving this Choreographer frame, ensuring // that the move of the content back to its original window will be reflected in // the next frame right after [onLaunchAnimationEnd] is called. // // TODO(b/330672236): Move this to TransitionAnimator. dialog.context.mainExecutor.execute { startController.onTransitionAnimationEnd(isExpandingFullyAbove) endController.onTransitionAnimationEnd(isExpandingFullyAbove) onLaunchAnimationEnd() } } override fun onTransitionAnimationProgress( state: TransitionAnimator.State, Loading
packages/SystemUI/animation/src/com/android/systemui/animation/TransitionAnimator.kt +7 −20 Original line number Diff line number Diff line Loading @@ -379,20 +379,8 @@ class TransitionAnimator( Log.d(TAG, "Animation ended") } // onAnimationEnd is called at the end of the animation, on a Choreographer // animation tick. During dialog launches, the following calls will move the // animated content from the dialog overlay back to its original position, and // this change must be reflected in the next frame given that we then sync the // next frame of both the content and dialog ViewRoots. During SysUI activity // launches, we will instantly collapse the shade at the end of the transition. // However, if those are rendered by Compose, whose compositions are also // scheduled on a Choreographer frame, any state change made *right now* won't // be reflected in the next frame given that a Choreographer frame can't // schedule another and have it happen in the same frame. So we post the // forwarded calls to [Controller.onLaunchAnimationEnd] in the main executor, // leaving this Choreographer frame, ensuring that any state change applied by // onTransitionAnimationEnd() will be reflected in the same frame. mainExecutor.execute { // TODO(b/330672236): Post this to the main thread instead so that it does not // flicker with Flexiglass enabled. controller.onTransitionAnimationEnd(isExpandingFullyAbove) transitionContainerOverlay.remove(windowBackgroundLayer) Loading @@ -401,7 +389,6 @@ class TransitionAnimator( } } } } ) animator.addUpdateListener { animation -> Loading