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

Commit 1f105c85 authored by Lucas Dupin's avatar Lucas Dupin Committed by Automerger Merge Worker
Browse files

Merge "More subtle sparkle animation" into sc-dev am: 3ad4d99e

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

Change-Id: I0682e1927ae38fac51c1970f3eaa9d7706f3e74b
parents 0923c1f4 3ad4d99e
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -39,7 +39,7 @@ import java.util.function.Consumer;
public final class RippleAnimationSession {
    private static final String TAG = "RippleAnimationSession";
    private static final int ENTER_ANIM_DURATION = 450;
    private static final int EXIT_ANIM_DURATION = 300;
    private static final int EXIT_ANIM_DURATION = 225;
    private static final long NOISE_ANIMATION_DURATION = 7000;
    private static final long MAX_NOISE_PHASE = NOISE_ANIMATION_DURATION / 120;
    private static final TimeInterpolator LINEAR_INTERPOLATOR = new LinearInterpolator();
+3 −3
Original line number Diff line number Diff line
@@ -102,8 +102,8 @@ final class RippleShader extends RuntimeShader {
    private static final String SHADER_MAIN = "vec4 main(vec2 p) {\n"
            + "    float fadeIn = subProgress(0., 0.1, in_progress);\n"
            + "    float scaleIn = subProgress(0., 0.45, in_progress);\n"
            + "    float fadeOutNoise = subProgress(0.5, 1., in_progress);\n"
            + "    float fadeOutRipple = subProgress(0.5, 0.75, in_progress);\n"
            + "    float fadeOutNoise = subProgress(0.5, 0.95, in_progress);\n"
            + "    float fadeOutRipple = subProgress(0.5, 1., in_progress);\n"
            + "    vec2 center = mix(in_touch, in_origin, scaleIn);\n"
            + "    float ring = softRing(p, center, in_maxRadius, scaleIn, 0.45);\n"
            + "    float alpha = min(fadeIn, 1. - fadeOutNoise);\n"
@@ -210,7 +210,7 @@ final class RippleShader extends RuntimeShader {
    }

    public void setResolution(float w, float h, int density) {
        final float densityScale = density * DisplayMetrics.DENSITY_DEFAULT_SCALE * 1.25f;
        final float densityScale = density * DisplayMetrics.DENSITY_DEFAULT_SCALE;
        setUniform("in_resolutionScale", new float[] {1f / w, 1f / h});
        setUniform("in_noiseScale", new float[] {densityScale / w, densityScale / h});
    }