mirror of
https://github.com/tachiyomiorg/tachiyomi.git
synced 2025-01-11 05:19:08 +01:00
Fixed covers (espicially gif covers) while browsing
This commit is contained in:
parent
d511638861
commit
892edd2b92
@ -369,8 +369,7 @@ class MangaDetailsController : BaseController,
|
||||
fun setPaletteColor() {
|
||||
val view = view ?: return
|
||||
coverColor = null
|
||||
GlideApp.with(view.context).load(manga)
|
||||
.diskCacheStrategy(DiskCacheStrategy.RESOURCE)
|
||||
GlideApp.with(view.context).load(manga).diskCacheStrategy(DiskCacheStrategy.RESOURCE)
|
||||
.signature(ObjectKey(MangaImpl.getLastCoverFetch(manga!!.id!!).toString()))
|
||||
.into(object : CustomTarget<Drawable>() {
|
||||
override fun onResourceReady(
|
||||
@ -391,13 +390,13 @@ class MangaDetailsController : BaseController,
|
||||
}
|
||||
coverColor = backDropColor
|
||||
getHeader()?.setBackDrop(backDropColor)
|
||||
getHeader()?.updateCover(presenter.manga, resource)
|
||||
if (toolbarIsColored) {
|
||||
val translucentColor = ColorUtils.setAlphaComponent(backDropColor, 175)
|
||||
(activity as MainActivity).toolbar.setBackgroundColor(translucentColor)
|
||||
activity?.window?.statusBarColor = translucentColor
|
||||
}
|
||||
}
|
||||
getHeader()?.updateCover(presenter.manga, true)
|
||||
}
|
||||
|
||||
override fun onLoadCleared(placeholder: Drawable?) {}
|
||||
|
@ -3,7 +3,6 @@ package eu.kanade.tachiyomi.ui.manga
|
||||
import android.annotation.SuppressLint
|
||||
import android.content.res.ColorStateList
|
||||
import android.graphics.Color
|
||||
import android.graphics.drawable.Drawable
|
||||
import android.view.MotionEvent
|
||||
import android.view.View
|
||||
import android.view.ViewGroup
|
||||
@ -308,14 +307,12 @@ class MangaHeaderHolder(
|
||||
}
|
||||
}
|
||||
|
||||
fun updateCover(manga: Manga, cover: Drawable? = null) {
|
||||
if (adapter.delegate.coverColor() == null) return
|
||||
GlideApp.with(view.context).load(cover ?: manga)
|
||||
.diskCacheStrategy(DiskCacheStrategy.RESOURCE)
|
||||
fun updateCover(manga: Manga, force: Boolean = false) {
|
||||
if (!manga.initialized || (adapter.delegate.coverColor() == null && manga.favorite && !force)) return
|
||||
GlideApp.with(view.context).load(manga).diskCacheStrategy(DiskCacheStrategy.RESOURCE)
|
||||
.signature(ObjectKey(MangaImpl.getLastCoverFetch(manga.id!!).toString()))
|
||||
.into(manga_cover)
|
||||
GlideApp.with(view.context).load(cover ?: manga)
|
||||
.diskCacheStrategy(DiskCacheStrategy.RESOURCE)
|
||||
GlideApp.with(view.context).load(manga).diskCacheStrategy(DiskCacheStrategy.RESOURCE)
|
||||
.signature(ObjectKey(MangaImpl.getLastCoverFetch(manga.id!!).toString())).centerCrop()
|
||||
.transition(DrawableTransitionOptions.withCrossFade()).into(backdrop)
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user