Square covers in list view (closes #3121)
This commit is contained in:
@@ -2,6 +2,9 @@ package eu.kanade.tachiyomi.ui.recent.updates
|
||||
|
||||
import android.view.View
|
||||
import com.bumptech.glide.load.engine.DiskCacheStrategy
|
||||
import com.bumptech.glide.load.resource.bitmap.CenterCrop
|
||||
import com.bumptech.glide.load.resource.bitmap.RoundedCorners
|
||||
import com.bumptech.glide.request.RequestOptions
|
||||
import eu.kanade.tachiyomi.R
|
||||
import eu.kanade.tachiyomi.data.download.model.Download
|
||||
import eu.kanade.tachiyomi.data.glide.GlideApp
|
||||
@@ -54,14 +57,6 @@ class UpdatesHolder(private val view: View, private val adapter: UpdatesAdapter)
|
||||
// Set manga title
|
||||
manga_title.text = item.manga.title
|
||||
|
||||
// Set cover
|
||||
GlideApp.with(itemView.context).clear(manga_cover)
|
||||
GlideApp.with(itemView.context)
|
||||
.load(item.manga.toMangaThumbnail())
|
||||
.diskCacheStrategy(DiskCacheStrategy.RESOURCE)
|
||||
.circleCrop()
|
||||
.into(manga_cover)
|
||||
|
||||
// Check if chapter is read and set correct color
|
||||
if (item.chapter.read) {
|
||||
chapter_title.setTextColor(readColor)
|
||||
@@ -73,6 +68,18 @@ class UpdatesHolder(private val view: View, private val adapter: UpdatesAdapter)
|
||||
|
||||
// Set chapter status
|
||||
notifyStatus(item.status)
|
||||
|
||||
// Set cover
|
||||
GlideApp.with(itemView.context).clear(manga_cover)
|
||||
|
||||
val radius = itemView.context.resources.getDimensionPixelSize(R.dimen.card_radius)
|
||||
val requestOptions = RequestOptions().transform(CenterCrop(), RoundedCorners(radius))
|
||||
GlideApp.with(itemView.context)
|
||||
.load(item.manga.toMangaThumbnail())
|
||||
.diskCacheStrategy(DiskCacheStrategy.RESOURCE)
|
||||
.apply(requestOptions)
|
||||
.dontAnimate()
|
||||
.into(manga_cover)
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user