update
This commit is contained in:
parent
4785b50894
commit
e767cbd980
@ -192,11 +192,13 @@ class MoLikedSongsActivity : MoBaseActivity(), LikedSongsAdapter.OnItemFavorites
|
||||
binding.downloadImg.setImageResource(R.drawable.more_downloaded_icon)
|
||||
binding.downloadTv.text =
|
||||
getString(R.string.download_remove_offline)
|
||||
LogTag.LogD(TAG,"like OnUpdateDownloadUi 1111")
|
||||
} else {
|
||||
binding.downloadLoading.visibility = View.GONE
|
||||
binding.downloadImg.visibility = View.VISIBLE
|
||||
binding.downloadImg.setImageResource(R.drawable.more_download_icon)
|
||||
binding.downloadTv.text = getString(R.string.download_save_offline)
|
||||
LogTag.LogD(TAG,"like OnUpdateDownloadUi 2222")
|
||||
}
|
||||
}
|
||||
|
||||
@ -321,6 +323,7 @@ class MoLikedSongsActivity : MoBaseActivity(), LikedSongsAdapter.OnItemFavorites
|
||||
}
|
||||
|
||||
private fun updateDownloadUI(download: Download) {
|
||||
LogTag.LogD(TAG,"like updateDownloadUI download-${download.state}")
|
||||
when (download.state) {
|
||||
Download.STATE_DOWNLOADING -> {
|
||||
binding.downloadLoading.visibility = View.VISIBLE
|
||||
@ -413,8 +416,15 @@ class MoLikedSongsActivity : MoBaseActivity(), LikedSongsAdapter.OnItemFavorites
|
||||
|
||||
val currentDownload = DownloadUtil.getCurrentIdDownload(bean.videoId)
|
||||
if (currentDownload != null) {
|
||||
//是否下载过资源,下载过资源就不走download的ui更新,因为 它肯定状态为3
|
||||
if(DownloadUtil.downloadResourceExist(bean.videoId)){
|
||||
requests.trySend(Request.OnUpdateDownloadUi(bean.videoId))
|
||||
}else{
|
||||
updateDownloadUI(currentDownload)
|
||||
}
|
||||
} else {
|
||||
requests.trySend(Request.OnUpdateDownloadUi(bean.videoId))
|
||||
}
|
||||
}
|
||||
|
||||
private fun hideBottomLayout() {
|
||||
|
||||
@ -532,7 +532,12 @@ class MoListDetailsActivity : MoBaseActivity(), DetailsListAdapter.OnItemMoreCli
|
||||
|
||||
val currentDownload = DownloadUtil.getCurrentIdDownload(bean.videoId!!)
|
||||
if (currentDownload != null) {
|
||||
//是否下载过资源,下载过资源就不走download的ui更新,因为 它肯定状态为3
|
||||
if(DownloadUtil.downloadResourceExist(bean.videoId)){
|
||||
requests.trySend(Request.OnUpdateDownloadUi(bean.videoId))
|
||||
}else{
|
||||
updateDownloadUI(currentDownload)
|
||||
}
|
||||
} else {
|
||||
requests.trySend(Request.OnUpdateDownloadUi(bean.videoId))
|
||||
}
|
||||
|
||||
@ -495,7 +495,12 @@ class MoPlaylistSongsActivity : MoBaseActivity() {
|
||||
|
||||
val currentDownload = DownloadUtil.getCurrentIdDownload(bean.videoId)
|
||||
if (currentDownload != null) {
|
||||
//是否下载过资源,下载过资源就不走download的ui更新,因为 它肯定状态为3
|
||||
if(DownloadUtil.downloadResourceExist(bean.videoId)){
|
||||
requests.trySend(Request.OnUpdateDownloadUi(bean.videoId))
|
||||
}else{
|
||||
updateDownloadUI(currentDownload)
|
||||
}
|
||||
} else {
|
||||
requests.trySend(Request.OnUpdateDownloadUi(bean.videoId))
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user