Possibly fixing some freezes and crashes

pull/3117/head
Jay 5 years ago
parent 1aebd3aced
commit d3579706d3

@ -347,7 +347,7 @@ class MangaDetailsPresenter(
* @param chapters the list of chapters to download. * @param chapters the list of chapters to download.
*/ */
fun downloadChapters(chapters: List<ChapterItem>) { fun downloadChapters(chapters: List<ChapterItem>) {
downloadManager.downloadChapters(manga, chapters) downloadManager.downloadChapters(manga, chapters.filter { !it.isDownloaded })
} }
fun restartDownloads() { fun restartDownloads() {

@ -55,8 +55,9 @@ object ImageUtil {
return null 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 val backgroundColor = if (useWhiteAlways) Color.WHITE else android.R.attr.colorBackground
if (image == null) return ColorDrawable(backgroundColor)
if (image.width < 50 || image.height < 50) if (image.width < 50 || image.height < 50)
return ColorDrawable(backgroundColor) return ColorDrawable(backgroundColor)
val top = 5 val top = 5

Loading…
Cancel
Save