Merge "Require InteractionJankMonitor." into tm-qpr-dev am: 065d85ea85

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

Change-Id: I646c51c7b4fce31d093871d9658366d893a47858
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
Bill Lin
2022-07-21 02:45:03 +00:00
committed by Automerger Merge Worker

View File

@@ -49,17 +49,16 @@ private const val TAG = "GhostedViewLaunchAnimatorController"
* Note: Avoid instantiating this directly and call [ActivityLaunchAnimator.Controller.fromView] * Note: Avoid instantiating this directly and call [ActivityLaunchAnimator.Controller.fromView]
* whenever possible instead. * whenever possible instead.
*/ */
open class GhostedViewLaunchAnimatorController( open class GhostedViewLaunchAnimatorController @JvmOverloads constructor(
/** The view that will be ghosted and from which the background will be extracted. */ /** The view that will be ghosted and from which the background will be extracted. */
private val ghostedView: View, private val ghostedView: View,
/** The [InteractionJankMonitor.CujType] associated to this animation. */ /** The [InteractionJankMonitor.CujType] associated to this animation. */
private val cujType: Int? = null, private val cujType: Int? = null,
private var interactionJankMonitor: InteractionJankMonitor? = null private var interactionJankMonitor: InteractionJankMonitor =
InteractionJankMonitor.getInstance(),
) : ActivityLaunchAnimator.Controller { ) : ActivityLaunchAnimator.Controller {
constructor(view: View, type: Int) : this(view, type, null)
/** The container to which we will add the ghost view and expanding background. */ /** The container to which we will add the ghost view and expanding background. */
override var launchContainer = ghostedView.rootView as ViewGroup override var launchContainer = ghostedView.rootView as ViewGroup
private val launchContainerOverlay: ViewGroupOverlay private val launchContainerOverlay: ViewGroupOverlay
@@ -203,7 +202,7 @@ open class GhostedViewLaunchAnimatorController(
val matrix = ghostView?.animationMatrix ?: Matrix.IDENTITY_MATRIX val matrix = ghostView?.animationMatrix ?: Matrix.IDENTITY_MATRIX
matrix.getValues(initialGhostViewMatrixValues) matrix.getValues(initialGhostViewMatrixValues)
cujType?.let { interactionJankMonitor?.begin(ghostedView, it) } cujType?.let { interactionJankMonitor.begin(ghostedView, it) }
} }
override fun onLaunchAnimationProgress( override fun onLaunchAnimationProgress(
@@ -289,7 +288,7 @@ open class GhostedViewLaunchAnimatorController(
return return
} }
cujType?.let { interactionJankMonitor?.end(it) } cujType?.let { interactionJankMonitor.end(it) }
backgroundDrawable?.wrapped?.alpha = startBackgroundAlpha backgroundDrawable?.wrapped?.alpha = startBackgroundAlpha