Merge "Fix warning log in DialogLaunchAnimator" into tm-qpr-dev

This commit is contained in:
Jordan Demeulenaere
2023-01-18 10:03:46 +00:00
committed by Android (Google) Code Review
2 changed files with 8 additions and 4 deletions

View File

@@ -237,13 +237,17 @@ constructor(
openedDialogs.firstOrNull {
it.dialog.window.decorView.viewRootImpl == controller.viewRoot
}
val animateFrom =
val controller =
animatedParent?.dialogContentWithBackground?.let {
Controller.fromView(it, controller.cuj)
}
?: controller
if (animatedParent == null && animateFrom !is LaunchableView) {
if (
animatedParent == null &&
controller is ViewDialogLaunchAnimatorController &&
controller.source !is LaunchableView
) {
// Make sure the View we launch from implements LaunchableView to avoid visibility
// issues. Given that we don't own dialog decorViews so we can't enforce it for launches
// from a dialog.
@@ -272,7 +276,7 @@ constructor(
launchAnimator,
callback,
interactionJankMonitor,
animateFrom,
controller,
onDialogDismissed = { openedDialogs.remove(it) },
dialog = dialog,
animateBackgroundBoundsChange,

View File

@@ -25,7 +25,7 @@ import com.android.internal.jank.InteractionJankMonitor
/** A [DialogLaunchAnimator.Controller] that can animate a [View] from/to a dialog. */
class ViewDialogLaunchAnimatorController
internal constructor(
private val source: View,
internal val source: View,
override val cuj: DialogCuj?,
) : DialogLaunchAnimator.Controller {
override val viewRoot: ViewRootImpl?