1

So I am working to build media tile, but whenever I play the a next song and use getUpdater(applicationContext).requestUpdate(MyTileService::class.java) it take few seconds before it refreshes the tile, so the next song starts but, the content of the tile do not change. I tries passing the new song title in the tile refresh code, but the tile refreshes before the variable refresh.

when(request.state!!.lastClickableId) {
    "play" -> pauseLayout(songTitle_txt!!,request.deviceParameters!!)
    "pause" -> playLayout(songTitle_txt!!,request.deviceParameters!!)
    else ->pauseLayout(songTitle_txt!!,request.deviceParameters!!)
}

I am also trying to figure how to update the ARC using the song progress, I can archived it the actual Wear OS app, but confused when it comes to tiles. Can one get a reference to the tile elements and only update those ?

Boken
  • 4,825
  • 10
  • 32
  • 42
Vicky P
  • 63
  • 6

1 Answers1

0

I think onclick actions might be different, but if an external event (play time, song name after it changes) is the trigger you will be limited in how often you can update.

See https://stackoverflow.com/a/70565444/1542667

Yuri Schimke
  • 12,435
  • 3
  • 35
  • 69
  • So I saw that post,so it seems realtime progress bar/arc is out of question for on a tile, so the next question would be, how can one delay the onclick action so that it happens after the song data is actually updated – Vicky P Mar 07 '22 at 19:07
  • 1
    Answering my own question, I added a delay(100) before between the call to music player and tile redraw, fixes the song title update. – Vicky P Mar 07 '22 at 20:28
  • Tiles are not designed at the moment to support real time updates, so I think you've taken the pragmatic choice for now. – Yuri Schimke Mar 08 '22 at 10:54