🙆🏻Ohh god removed AsyncTask finally

This commit is contained in:
Hemanth S 2020-08-21 17:15:38 +05:30
parent 069d45e8df
commit a7e55cc5bf

View file

@ -1,6 +1,5 @@
package code.name.monkey.retromusic.fragments.base package code.name.monkey.retromusic.fragments.base
import android.annotation.SuppressLint
import android.content.ContentUris import android.content.ContentUris
import android.content.Intent import android.content.Intent
import android.media.MediaMetadataRetriever import android.media.MediaMetadataRetriever
@ -193,8 +192,7 @@ abstract class AbsPlayerFragment(@LayoutRes layout: Int) : AbsMainActivityFragme
updateIsFavorite() updateIsFavorite()
updateLyrics() updateLyrics()
} }
@SuppressLint("StaticFieldLeak")
fun updateIsFavorite() { fun updateIsFavorite() {
lifecycleScope.launch(IO) { lifecycleScope.launch(IO) {
val playlist: PlaylistEntity = repository.favoritePlaylist().first() val playlist: PlaylistEntity = repository.favoritePlaylist().first()
@ -214,7 +212,6 @@ abstract class AbsPlayerFragment(@LayoutRes layout: Int) : AbsMainActivityFragme
} }
} }
@SuppressLint("StaticFieldLeak")
private fun updateLyrics() { private fun updateLyrics() {
setLyrics(null) setLyrics(null)
lifecycleScope.launch(IO) { lifecycleScope.launch(IO) {
@ -273,7 +270,7 @@ abstract class AbsPlayerFragment(@LayoutRes layout: Int) : AbsMainActivityFragme
protected fun getUpNextAndQueueTime(): String { protected fun getUpNextAndQueueTime(): String {
val duration = MusicPlayerRemote.getQueueDurationMillis(MusicPlayerRemote.position) val duration = MusicPlayerRemote.getQueueDurationMillis(MusicPlayerRemote.position)
return MusicUtil.buildInfoString( return MusicUtil.buildInfoString(
resources.getString(R.string.up_next), resources.getString(R.string.up_next),
MusicUtil.getReadableDurationString(duration) MusicUtil.getReadableDurationString(duration)