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

Commit 07f55640 authored by nift4's avatar nift4 Committed by Jan Altensen
Browse files

SystemUI: Enable fading squiggle animation of qs media player

- fixes the line having different curves between played and unplayed section
- before https://imgur.com/a/vn4smvb
- after https://imgur.com/a/7rL4jV6

Change-Id: I2d2522c66341662eff74eb7d3686be7aa6e7ac5c
parent 1668fe8e
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -106,7 +106,8 @@ open class SeekBarObserver(private val holder: MediaViewHolder) :
        holder.seekBar.thumb.alpha = if (data.seekAvailable) 255 else 0
        holder.seekBar.isEnabled = data.seekAvailable
        progressDrawable?.animate = data.playing && !data.scrubbing && animationEnabled
        progressDrawable?.transitionEnabled = !data.seekAvailable
        progressDrawable?.minWaveEndpoint = if (data.seekAvailable) 0f else 0.2f
        progressDrawable?.matchedWaveEndpoint = if (data.seekAvailable) 1f else 0.6f

        if (holder.seekBar.maxHeight != seekBarEnabledMaxHeight) {
            holder.seekBar.maxHeight = seekBarEnabledMaxHeight
+3 −3
Original line number Diff line number Diff line
@@ -52,11 +52,11 @@ class SquigglyProgress : Drawable() {
    private var lastFrameTime = -1L

    /* distance over which amplitude drops to zero, measured in wavelengths */
    private val transitionPeriods = 1.5f
    var transitionPeriods = 1.5f
    /* wave endpoint as percentage of bar when play position is zero */
    private val minWaveEndpoint = 0.2f
    var minWaveEndpoint = 0.2f
    /* wave endpoint as percentage of bar when play position matches wave endpoint */
    private val matchedWaveEndpoint = 0.6f
    var matchedWaveEndpoint = 0.6f

    // Horizontal length of the sine wave
    var waveLength = 0f