diff --git a/app/src/main/java/eu/kanade/tachiyomi/data/download/DownloadCache.kt b/app/src/main/java/eu/kanade/tachiyomi/data/download/DownloadCache.kt index d5c3c9fd08..94d57d292a 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/data/download/DownloadCache.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/data/download/DownloadCache.kt @@ -77,7 +77,7 @@ class DownloadCache( checkRenew() - val files = mangaFiles[manga.id] ?: return false + val files = mangaFiles[manga.id]?.toSet() ?: return false return files.any { file -> provider.getValidChapterDirNames(chapter).any { it.toLowerCase() == file.toLowerCase() } } diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/manga/MangaDetailsController.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/manga/MangaDetailsController.kt index 6a815565f5..5727c816eb 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/manga/MangaDetailsController.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/manga/MangaDetailsController.kt @@ -275,7 +275,8 @@ class MangaDetailsController : BaseController, } private fun setInsets(insets: WindowInsets, appbarHeight: Int, offset: Int) { - recycler?.updatePaddingRelative(bottom = insets.systemWindowInsetBottom) + val recycler = recycler ?: return + recycler.updatePaddingRelative(bottom = insets.systemWindowInsetBottom) headerHeight = appbarHeight + insets.systemWindowInsetTop swipe_refresh.setProgressViewOffset(false, (-40).dpToPx, headerHeight + offset) // 1dp extra to line up chapter header and manga header diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/recent_updates/RecentChapterHolder.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/recent_updates/RecentChapterHolder.kt index 76b86eebf0..b24a3ab0e4 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/recent_updates/RecentChapterHolder.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/recent_updates/RecentChapterHolder.kt @@ -1,5 +1,6 @@ package eu.kanade.tachiyomi.ui.recent_updates +import android.app.Activity import android.view.View import androidx.core.content.ContextCompat import com.bumptech.glide.load.engine.DiskCacheStrategy @@ -69,13 +70,12 @@ class RecentChapterHolder(private val view: View, private val adapter: RecentCha } // Set cover - GlideApp.with(itemView.context).clear(manga_cover) - if (!item.manga.thumbnail_url.isNullOrEmpty()) { - GlideApp.with(itemView.context) - .load(item.manga) - .diskCacheStrategy(DiskCacheStrategy.RESOURCE) - .circleCrop() - .into(manga_cover) + if ((view.context as? Activity)?.isDestroyed != true) { + GlideApp.with(itemView.context).clear(manga_cover) + if (!item.manga.thumbnail_url.isNullOrEmpty()) { + GlideApp.with(itemView.context).load(item.manga) + .diskCacheStrategy(DiskCacheStrategy.RESOURCE).circleCrop().into(manga_cover) + } } val chapterColor = ChapterUtil.chapterColor(itemView.context, item) diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/source/SourceController.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/source/SourceController.kt index 7fdb2d7618..54a9a91c1d 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/source/SourceController.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/source/SourceController.kt @@ -151,17 +151,19 @@ class SourceController : NucleusController(), } override fun onStateChanged(p0: View, state: Int) { - val ext_bottom_sheet = ext_bottom_sheet ?: return - if (state == BottomSheetBehavior.STATE_EXPANDED) activity?.appbar?.y = 0f + val extBottomSheet = ext_bottom_sheet ?: return + if (state == BottomSheetBehavior.STATE_EXPANDED) { + activity?.appbar?.y = 0f + } if (state == BottomSheetBehavior.STATE_EXPANDED || state == BottomSheetBehavior.STATE_COLLAPSED) { - sheet_layout.alpha = + sheet_layout?.alpha = if (state == BottomSheetBehavior.STATE_COLLAPSED) 1f else 0f showingExtensions = state == BottomSheetBehavior.STATE_EXPANDED setTitle() if (state == BottomSheetBehavior.STATE_EXPANDED) - ext_bottom_sheet.fetchOnlineExtensionsIfNeeded() - else ext_bottom_sheet.shouldCallApi = true + extBottomSheet.fetchOnlineExtensionsIfNeeded() + else extBottomSheet.shouldCallApi = true activity?.invalidateOptionsMenu() } diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/source/browse/BrowseSourceController.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/source/browse/BrowseSourceController.kt index f356d4124b..6ec5fe72f9 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/source/browse/BrowseSourceController.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/source/browse/BrowseSourceController.kt @@ -190,7 +190,7 @@ open class BrowseSourceController(bundle: Bundle) : recycler.adapter = adapter scrollViewWith(recycler, true, afterInsets = { insets -> - fab.updateLayoutParams { + fab?.updateLayoutParams { bottomMargin = insets.systemWindowInsetBottom + 16.dpToPx } })