Merge "Fix warning log in DialogLaunchAnimator" into tm-qpr-dev am: 7206db68f8

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/20980298

Change-Id: Id7eed5875fe4215f1d63216098b44ef880658daf
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
Jordan Demeulenaere
2023-01-18 10:15:55 +00:00
committed by Automerger Merge Worker
2 changed files with 8 additions and 4 deletions

View File

@@ -237,13 +237,17 @@ constructor(
openedDialogs.firstOrNull { openedDialogs.firstOrNull {
it.dialog.window.decorView.viewRootImpl == controller.viewRoot it.dialog.window.decorView.viewRootImpl == controller.viewRoot
} }
val animateFrom = val controller =
animatedParent?.dialogContentWithBackground?.let { animatedParent?.dialogContentWithBackground?.let {
Controller.fromView(it, controller.cuj) Controller.fromView(it, controller.cuj)
} }
?: controller ?: 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 // 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 // issues. Given that we don't own dialog decorViews so we can't enforce it for launches
// from a dialog. // from a dialog.
@@ -272,7 +276,7 @@ constructor(
launchAnimator, launchAnimator,
callback, callback,
interactionJankMonitor, interactionJankMonitor,
animateFrom, controller,
onDialogDismissed = { openedDialogs.remove(it) }, onDialogDismissed = { openedDialogs.remove(it) },
dialog = dialog, dialog = dialog,
animateBackgroundBoundsChange, 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. */ /** A [DialogLaunchAnimator.Controller] that can animate a [View] from/to a dialog. */
class ViewDialogLaunchAnimatorController class ViewDialogLaunchAnimatorController
internal constructor( internal constructor(
private val source: View, internal val source: View,
override val cuj: DialogCuj?, override val cuj: DialogCuj?,
) : DialogLaunchAnimator.Controller { ) : DialogLaunchAnimator.Controller {
override val viewRoot: ViewRootImpl? override val viewRoot: ViewRootImpl?