修复游戏下载红点更新问题

This commit is contained in:
juntao
2021-02-02 17:36:35 +08:00
parent 372230092a
commit 1ca6a2c795

View File

@ -145,14 +145,15 @@ class DownloadFragment : BaseFragment_TabLayout() {
@Subscribe(threadMode = ThreadMode.MAIN)
fun onEventMainThread(changed: EBDownloadChanged) {
if ("download" == changed.type) {
updateDownloadHint()
// 因为数据库已安装的数据是是比这个回调晚的所以这里延时500ms
postDelayedRunnable({ updateDownloadHint() }, 500L)
} else if ("update" == changed.type) {
updateUpdateHint()
}
}
private fun updateDownloadHint() {
if (!::mDownloadNumber.isInitialized) return
if (!::mDownloadNumber.isInitialized || !isAdded) return
val downloadData = DownloadManager.getInstance(context).allDownloadEntityExcludeSilentUpdate
if (downloadData.size > 0) {