Skip to content
Snippets Groups Projects
Commit f216d45c authored by Nick's avatar Nick :v: Committed by Dhina17
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 02a13b8e
No related branches found
No related tags found
No related merge requests found
......@@ -119,7 +119,8 @@ open class SeekBarObserver(private val holder: MediaViewHolder) :
holder.seekBar.isEnabled = data.seekAvailable
progressDrawable?.animate =
data.playing && !data.scrubbing && animationEnabled && data.listening
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
......
......@@ -53,11 +53,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
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment