Possibly fixing some freezes and crashes
This commit is contained in:
parent
1aebd3aced
commit
d3579706d3
2 changed files with 3 additions and 2 deletions
|
@ -347,7 +347,7 @@ class MangaDetailsPresenter(
|
|||
* @param chapters the list of chapters to download.
|
||||
*/
|
||||
fun downloadChapters(chapters: List<ChapterItem>) {
|
||||
downloadManager.downloadChapters(manga, chapters)
|
||||
downloadManager.downloadChapters(manga, chapters.filter { !it.isDownloaded })
|
||||
}
|
||||
|
||||
fun restartDownloads() {
|
||||
|
|
|
@ -55,8 +55,9 @@ object ImageUtil {
|
|||
return null
|
||||
}
|
||||
|
||||
fun autoSetBackground(image: Bitmap, useWhiteAlways: Boolean): Drawable {
|
||||
fun autoSetBackground(image: Bitmap?, useWhiteAlways: Boolean): Drawable {
|
||||
val backgroundColor = if (useWhiteAlways) Color.WHITE else android.R.attr.colorBackground
|
||||
if (image == null) return ColorDrawable(backgroundColor)
|
||||
if (image.width < 50 || image.height < 50)
|
||||
return ColorDrawable(backgroundColor)
|
||||
val top = 5
|
||||
|
|
Reference in a new issue