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

Commit f7720a31 authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Animate out toast elevation" into sc-dev

parents ee1219ac c1ad84dc
Loading
Loading
Loading
Loading
+18 −6
Original line number Diff line number Diff line
@@ -76,29 +76,41 @@ class ToastDefaultAnimation {
            }
            val linearInterp = LinearInterpolator()
            val scaleInterp = PathInterpolator(0.3f, 0f, 1f, 1f)
            val sX = ObjectAnimator.ofFloat(view, "scaleX", 1f, 0.9f).apply {
            val viewScaleX = ObjectAnimator.ofFloat(view, "scaleX", 1f, 0.9f).apply {
                interpolator = scaleInterp
                duration = 250
            }
            val sY = ObjectAnimator.ofFloat(view, "scaleY", 1f, 0.9f).apply {
            val viewScaleY = ObjectAnimator.ofFloat(view, "scaleY", 1f, 0.9f).apply {
                interpolator = scaleInterp
                duration = 250
            }
            val vA = ObjectAnimator.ofFloat(view, "alpha", 1f, 0f).apply {
            val viewElevation = ObjectAnimator.ofFloat(view, "elevation",
                view.elevation, 0f).apply {
                interpolator = linearInterp
                duration = 40
                startDelay = 150
            }
            val viewAlpha = ObjectAnimator.ofFloat(view, "alpha", 1f, 0f).apply {
                interpolator = linearInterp
                duration = 100
                startDelay = 150
            }
            val tA = ObjectAnimator.ofFloat(text, "alpha", 1f, 0f).apply {
            val textAlpha = ObjectAnimator.ofFloat(text, "alpha", 1f, 0f).apply {
                interpolator = linearInterp
                duration = 166
            }
            val iA = ObjectAnimator.ofFloat(icon, "alpha", 1f, 0f).apply {
            val iconAlpha = ObjectAnimator.ofFloat(icon, "alpha", 1f, 0f).apply {
                interpolator = linearInterp
                duration = 166
            }
            return AnimatorSet().apply {
                playTogether(sX, sY, vA, tA, iA)
                playTogether(
                    viewScaleX,
                    viewScaleY,
                    viewElevation,
                    viewAlpha,
                    textAlpha,
                    iconAlpha)
            }
        }
    }