https://kotlinlang.org logo
Title
j

Jeff

01/17/2023, 1:56 PM
Any ideas of how to implement this layout in compose? The lyrics are highlighted as the song plays.
n

Nicolai

01/17/2023, 2:03 PM
Do you have the timestamp for each word? Otherwise it would just be guessing which word we've reached.
j

Jeff

01/17/2023, 2:05 PM
No timestamps currently. I have some midi files and need to match them to the lyrics
c

Csaba Szugyiczki

01/17/2023, 2:05 PM
Text APIs in Compose are pretty powerful. You might be able to do it by updating the span style of each word as the song progresses.

https://www.youtube.com/watch?v=_qls2CEAbxI&t=201s

But I guess If you need autoscroll and everything that Spotify has you might need to implement your View by drawing directly on the canvas yourself
e

efemoney

01/17/2023, 3:26 PM
Or maybe have the lyrics split into multiple `Text`s in a LazyColumn and focus the right sentence as the song proceeds, it should scroll as different sentences are focused. Text color can be (animated) based on focused state of that text sequence
v

Valentin Gusselnikov

01/17/2023, 5:01 PM
j

Jeff

01/18/2023, 11:32 AM
Thanks guys