mirror of
https://github.com/tachiyomiorg/tachiyomi.git
synced 2024-11-14 05:15:10 +01:00
Fixing tracepot crashes p1
This commit is contained in:
parent
7b9ee0d75b
commit
283ff636f4
@ -77,7 +77,7 @@ class DownloadCache(
|
|||||||
|
|
||||||
checkRenew()
|
checkRenew()
|
||||||
|
|
||||||
val files = mangaFiles[manga.id] ?: return false
|
val files = mangaFiles[manga.id]?.toSet() ?: return false
|
||||||
return files.any { file -> provider.getValidChapterDirNames(chapter).any {
|
return files.any { file -> provider.getValidChapterDirNames(chapter).any {
|
||||||
it.toLowerCase() == file.toLowerCase()
|
it.toLowerCase() == file.toLowerCase()
|
||||||
} }
|
} }
|
||||||
|
@ -275,7 +275,8 @@ class MangaDetailsController : BaseController,
|
|||||||
}
|
}
|
||||||
|
|
||||||
private fun setInsets(insets: WindowInsets, appbarHeight: Int, offset: Int) {
|
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
|
headerHeight = appbarHeight + insets.systemWindowInsetTop
|
||||||
swipe_refresh.setProgressViewOffset(false, (-40).dpToPx, headerHeight + offset)
|
swipe_refresh.setProgressViewOffset(false, (-40).dpToPx, headerHeight + offset)
|
||||||
// 1dp extra to line up chapter header and manga header
|
// 1dp extra to line up chapter header and manga header
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
package eu.kanade.tachiyomi.ui.recent_updates
|
package eu.kanade.tachiyomi.ui.recent_updates
|
||||||
|
|
||||||
|
import android.app.Activity
|
||||||
import android.view.View
|
import android.view.View
|
||||||
import androidx.core.content.ContextCompat
|
import androidx.core.content.ContextCompat
|
||||||
import com.bumptech.glide.load.engine.DiskCacheStrategy
|
import com.bumptech.glide.load.engine.DiskCacheStrategy
|
||||||
@ -69,13 +70,12 @@ class RecentChapterHolder(private val view: View, private val adapter: RecentCha
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Set cover
|
// Set cover
|
||||||
|
if ((view.context as? Activity)?.isDestroyed != true) {
|
||||||
GlideApp.with(itemView.context).clear(manga_cover)
|
GlideApp.with(itemView.context).clear(manga_cover)
|
||||||
if (!item.manga.thumbnail_url.isNullOrEmpty()) {
|
if (!item.manga.thumbnail_url.isNullOrEmpty()) {
|
||||||
GlideApp.with(itemView.context)
|
GlideApp.with(itemView.context).load(item.manga)
|
||||||
.load(item.manga)
|
.diskCacheStrategy(DiskCacheStrategy.RESOURCE).circleCrop().into(manga_cover)
|
||||||
.diskCacheStrategy(DiskCacheStrategy.RESOURCE)
|
}
|
||||||
.circleCrop()
|
|
||||||
.into(manga_cover)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
val chapterColor = ChapterUtil.chapterColor(itemView.context, item)
|
val chapterColor = ChapterUtil.chapterColor(itemView.context, item)
|
||||||
|
@ -151,17 +151,19 @@ class SourceController : NucleusController<SourcePresenter>(),
|
|||||||
}
|
}
|
||||||
|
|
||||||
override fun onStateChanged(p0: View, state: Int) {
|
override fun onStateChanged(p0: View, state: Int) {
|
||||||
val ext_bottom_sheet = ext_bottom_sheet ?: return
|
val extBottomSheet = ext_bottom_sheet ?: return
|
||||||
if (state == BottomSheetBehavior.STATE_EXPANDED) activity?.appbar?.y = 0f
|
if (state == BottomSheetBehavior.STATE_EXPANDED) {
|
||||||
|
activity?.appbar?.y = 0f
|
||||||
|
}
|
||||||
if (state == BottomSheetBehavior.STATE_EXPANDED ||
|
if (state == BottomSheetBehavior.STATE_EXPANDED ||
|
||||||
state == BottomSheetBehavior.STATE_COLLAPSED) {
|
state == BottomSheetBehavior.STATE_COLLAPSED) {
|
||||||
sheet_layout.alpha =
|
sheet_layout?.alpha =
|
||||||
if (state == BottomSheetBehavior.STATE_COLLAPSED) 1f else 0f
|
if (state == BottomSheetBehavior.STATE_COLLAPSED) 1f else 0f
|
||||||
showingExtensions = state == BottomSheetBehavior.STATE_EXPANDED
|
showingExtensions = state == BottomSheetBehavior.STATE_EXPANDED
|
||||||
setTitle()
|
setTitle()
|
||||||
if (state == BottomSheetBehavior.STATE_EXPANDED)
|
if (state == BottomSheetBehavior.STATE_EXPANDED)
|
||||||
ext_bottom_sheet.fetchOnlineExtensionsIfNeeded()
|
extBottomSheet.fetchOnlineExtensionsIfNeeded()
|
||||||
else ext_bottom_sheet.shouldCallApi = true
|
else extBottomSheet.shouldCallApi = true
|
||||||
activity?.invalidateOptionsMenu()
|
activity?.invalidateOptionsMenu()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -190,7 +190,7 @@ open class BrowseSourceController(bundle: Bundle) :
|
|||||||
recycler.adapter = adapter
|
recycler.adapter = adapter
|
||||||
|
|
||||||
scrollViewWith(recycler, true, afterInsets = { insets ->
|
scrollViewWith(recycler, true, afterInsets = { insets ->
|
||||||
fab.updateLayoutParams<ViewGroup.MarginLayoutParams> {
|
fab?.updateLayoutParams<ViewGroup.MarginLayoutParams> {
|
||||||
bottomMargin = insets.systemWindowInsetBottom + 16.dpToPx
|
bottomMargin = insets.systemWindowInsetBottom + 16.dpToPx
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
Loading…
Reference in New Issue
Block a user