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

Commit 720fc762 authored by Yein Jo's avatar Yein Jo Committed by Automerger Merge Worker
Browse files

Merge "Migrate AuthRippleView to use RippleShader#FadeParams to deprecate...

Merge "Migrate AuthRippleView to use RippleShader#FadeParams to deprecate rippleFill." into tm-qpr-dev am: a95c5ae6 am: d2219887

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



Change-Id: I1697582a5e042c483f88efc19ef1c387d218ab3c
Signed-off-by: default avatarAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
parents 557aaf82 d2219887
Loading
Loading
Loading
Loading
+13 −1
Original line number Diff line number Diff line
@@ -88,6 +88,7 @@ class AuthRippleView(context: Context?, attrs: AttributeSet?) : View(context, at
        rippleShader.color = 0xffffffff.toInt() // default color
        rippleShader.rawProgress = 0f
        rippleShader.sparkleStrength = RIPPLE_SPARKLE_STRENGTH
        setupRippleFadeParams()
        ripplePaint.shader = rippleShader

        dwellShader.color = 0xffffffff.toInt() // default color
@@ -294,7 +295,6 @@ class AuthRippleView(context: Context?, attrs: AttributeSet?) : View(context, at
            )
            addListener(object : AnimatorListenerAdapter() {
                override fun onAnimationStart(animation: Animator?) {
                    rippleShader.rippleFill = false
                    drawRipple = true
                    visibility = VISIBLE
                }
@@ -339,6 +339,18 @@ class AuthRippleView(context: Context?, attrs: AttributeSet?) : View(context, at
        )
    }

    private fun setupRippleFadeParams() {
        with(rippleShader) {
            baseRingFadeParams.fadeOutStart = RippleShader.DEFAULT_BASE_RING_FADE_OUT_START
            baseRingFadeParams.fadeOutEnd = RippleShader.DEFAULT_FADE_OUT_END

            centerFillFadeParams.fadeInStart = RippleShader.DEFAULT_FADE_IN_START
            centerFillFadeParams.fadeInEnd = RippleShader.DEFAULT_CENTER_FILL_FADE_IN_END
            centerFillFadeParams.fadeOutStart = RippleShader.DEFAULT_CENTER_FILL_FADE_OUT_START
            centerFillFadeParams.fadeOutEnd = RippleShader.DEFAULT_CENTER_FILL_FADE_OUT_END
        }
    }

    override fun onDraw(canvas: Canvas?) {
        // To reduce overdraw, we mask the effect to a circle whose radius is big enough to cover
        // the active effect area. Values here should be kept in sync with the