From dcf250fcf3b38483546db9c5f893182df8ce871a Mon Sep 17 00:00:00 2001 From: Jay Date: Sun, 10 May 2020 17:33:42 -0400 Subject: [PATCH] Fixing a few more tracepot issues --- .../kanade/tachiyomi/ui/library/LibraryController.kt | 1 + .../kanade/tachiyomi/ui/recents/RecentMangaHolder.kt | 10 +++++++--- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/library/LibraryController.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/library/LibraryController.kt index 80ea85568c..ac81d03b9c 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/library/LibraryController.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/library/LibraryController.kt @@ -893,6 +893,7 @@ class LibraryController( } override fun canDrag(): Boolean { + filter_bottom_sheet ?: return false val filterOff = !filter_bottom_sheet.hasActiveFilters() && !preferences.hideCategories().getOrDefault() return filterOff && adapter.mode != SelectableAdapter.Mode.MULTI diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/recents/RecentMangaHolder.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/recents/RecentMangaHolder.kt index 6cd71f10c0..729a9acb1c 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/recents/RecentMangaHolder.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/recents/RecentMangaHolder.kt @@ -1,5 +1,6 @@ package eu.kanade.tachiyomi.ui.recents +import android.app.Activity import android.view.View import com.bumptech.glide.load.engine.DiskCacheStrategy import com.bumptech.glide.signature.ObjectKey @@ -70,9 +71,12 @@ class RecentMangaHolder( R.string.read_, item.mch.history.last_read.timeSpanFromNow ) } - GlideApp.with(itemView.context).load(item.mch.manga).diskCacheStrategy(DiskCacheStrategy - .RESOURCE) - .signature(ObjectKey(MangaImpl.getLastCoverFetch(item.mch.manga.id!!).toString())).into(cover_thumbnail) + if ((itemView.context as? Activity)?.isDestroyed != true) { + GlideApp.with(itemView.context).load(item.mch.manga).diskCacheStrategy( + DiskCacheStrategy.RESOURCE + ).signature(ObjectKey(MangaImpl.getLastCoverFetch(item.mch.manga.id!!).toString())) + .into(cover_thumbnail) + } notifyStatus( if (adapter.isSelected(adapterPosition)) Download.CHECKED else item.status, item.progress