Fixed a lyrics crash
This commit is contained in:
parent
7a82883f57
commit
91b7eeeb45
3 changed files with 8 additions and 4 deletions
|
@ -52,6 +52,7 @@ import code.name.monkey.retromusic.util.color.MediaNotificationProcessor
|
|||
import code.name.monkey.retromusic.util.logD
|
||||
import kotlinx.coroutines.Dispatchers
|
||||
import kotlinx.coroutines.launch
|
||||
import kotlinx.coroutines.withContext
|
||||
|
||||
class PlayerAlbumCoverFragment : AbsMusicServiceFragment(R.layout.fragment_player_album_cover),
|
||||
ViewPager.OnPageChangeListener, MusicProgressViewUpdateHelper.Callback,
|
||||
|
@ -95,8 +96,10 @@ class PlayerAlbumCoverFragment : AbsMusicServiceFragment(R.layout.fragment_playe
|
|||
if (embeddedLyrics != null) {
|
||||
binding.lyricsView.loadLrc(embeddedLyrics)
|
||||
} else {
|
||||
binding.lyricsView.reset()
|
||||
binding.lyricsView.setLabel(context?.getString(R.string.no_lyrics_found))
|
||||
withContext(Dispatchers.Main) {
|
||||
binding.lyricsView.reset()
|
||||
binding.lyricsView.setLabel(context?.getString(R.string.no_lyrics_found))
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue