mirror of
https://github.com/null2264/yokai.git
synced 2025-06-21 10:44:42 +00:00
refactor(download): Move .show() inside with
block
This commit is contained in:
parent
17eec5f6aa
commit
985ac6d7a8
1 changed files with 7 additions and 4 deletions
|
@ -155,9 +155,10 @@ internal class DownloadNotifier(private val context: Context) {
|
||||||
}
|
}
|
||||||
setStyle(null)
|
setStyle(null)
|
||||||
setProgress(download.pages!!.size, download.downloadedImages, false)
|
setProgress(download.pages!!.size, download.downloadedImages, false)
|
||||||
|
|
||||||
|
// Displays the progress bar on notification
|
||||||
|
show()
|
||||||
}
|
}
|
||||||
// Displays the progress bar on notification
|
|
||||||
notification.show()
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -212,8 +213,9 @@ internal class DownloadNotifier(private val context: Context) {
|
||||||
clearActions()
|
clearActions()
|
||||||
setContentIntent(NotificationHandler.openDownloadManagerPendingActivity(context))
|
setContentIntent(NotificationHandler.openDownloadManagerPendingActivity(context))
|
||||||
setProgress(0, 0, false)
|
setProgress(0, 0, false)
|
||||||
|
|
||||||
|
show(Notifications.ID_DOWNLOAD_CHAPTER_ERROR)
|
||||||
}
|
}
|
||||||
notification.show(Notifications.ID_DOWNLOAD_CHAPTER_ERROR)
|
|
||||||
|
|
||||||
// Reset download information
|
// Reset download information
|
||||||
isDownloading = false
|
isDownloading = false
|
||||||
|
@ -291,8 +293,9 @@ internal class DownloadNotifier(private val context: Context) {
|
||||||
}
|
}
|
||||||
color = ContextCompat.getColor(context, R.color.secondaryTachiyomi)
|
color = ContextCompat.getColor(context, R.color.secondaryTachiyomi)
|
||||||
setProgress(0, 0, false)
|
setProgress(0, 0, false)
|
||||||
|
|
||||||
|
show(Notifications.ID_DOWNLOAD_CHAPTER_ERROR)
|
||||||
}
|
}
|
||||||
notification.show(Notifications.ID_DOWNLOAD_CHAPTER_ERROR)
|
|
||||||
|
|
||||||
// Reset download information
|
// Reset download information
|
||||||
errorThrown = true
|
errorThrown = true
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue