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

Commit 6b9bba4c authored by Evan Laird's avatar Evan Laird
Browse files

[Ongoing call] Fix chip clip when using activity launch animator

Test: manual
Bug: 306242010
Change-Id: I60a81a8e79dfc564322368e96cf6fcd645314536
parent 44ff5531
Loading
Loading
Loading
Loading
+14 −3
Original line number Original line Diff line number Diff line
@@ -68,6 +68,7 @@ constructor(
    override var launchContainer = ghostedView.rootView as ViewGroup
    override var launchContainer = ghostedView.rootView as ViewGroup
    private val launchContainerOverlay: ViewGroupOverlay
    private val launchContainerOverlay: ViewGroupOverlay
        get() = launchContainer.overlay
        get() = launchContainer.overlay

    private val launchContainerLocation = IntArray(2)
    private val launchContainerLocation = IntArray(2)


    /** The ghost view that is drawn and animated instead of the ghosted view. */
    /** The ghost view that is drawn and animated instead of the ghosted view. */
@@ -206,9 +207,8 @@ constructor(
            return
            return
        }
        }


        backgroundView = FrameLayout(launchContainer.context).also {
        backgroundView =
            launchContainerOverlay.add(it)
            FrameLayout(launchContainer.context).also { launchContainerOverlay.add(it) }
        }


        // We wrap the ghosted view background and use it to draw the expandable background. Its
        // We wrap the ghosted view background and use it to draw the expandable background. Its
        // alpha will be set to 0 as soon as we start drawing the expanding background.
        // alpha will be set to 0 as soon as we start drawing the expanding background.
@@ -226,6 +226,17 @@ constructor(
        // the content before fading out the background.
        // the content before fading out the background.
        ghostView = GhostView.addGhost(ghostedView, launchContainer)
        ghostView = GhostView.addGhost(ghostedView, launchContainer)


        // [GhostView.addGhost], the result of which is our [ghostView], creates a [GhostView], and
        // adds it first to a [FrameLayout] container. It then adds _that_ container to an
        // [OverlayViewGroup]. We need to turn off clipping for that container view. Currently,
        // however, the only way to get a reference to that overlay is by going through our
        // [ghostView]. The [OverlayViewGroup] will always be its grandparent view.
        // TODO(b/306652954) reference the overlay view group directly if we can
        (ghostView?.parent?.parent as? ViewGroup)?.let {
            it.clipChildren = false
            it.clipToPadding = false
        }

        val matrix = ghostView?.animationMatrix ?: Matrix.IDENTITY_MATRIX
        val matrix = ghostView?.animationMatrix ?: Matrix.IDENTITY_MATRIX
        matrix.getValues(initialGhostViewMatrixValues)
        matrix.getValues(initialGhostViewMatrixValues)