From 1e454f5a6cf9a6281be19d71f3c78db3075ae608 Mon Sep 17 00:00:00 2001 From: Jays2Kings Date: Mon, 19 Apr 2021 03:02:35 -0400 Subject: [PATCH] Updates mode of recents now has a square cover --- .../tachiyomi/ui/recents/RecentMangaHolder.kt | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) 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 ca0ae16e9d..8e4b814f2e 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 @@ -2,10 +2,15 @@ package eu.kanade.tachiyomi.ui.recents import android.app.Activity import android.view.View +import android.view.ViewGroup +import android.widget.ImageView import androidx.constraintlayout.widget.ConstraintLayout import androidx.core.view.isVisible import androidx.core.view.updateLayoutParams +import coil.size.Precision +import coil.size.Scale import eu.kanade.tachiyomi.R +import eu.kanade.tachiyomi.data.database.models.Manga import eu.kanade.tachiyomi.data.download.model.Download import eu.kanade.tachiyomi.data.image.coil.loadLibraryManga import eu.kanade.tachiyomi.databinding.RecentMangaItemBinding @@ -62,7 +67,18 @@ class RecentMangaHolder( topToBottom = R.id.subtitle } } - binding.subtitle.updateLayoutParams { + with(binding.coverThumbnail) { + adjustViewBounds = !isUpdates + scaleType = if (isUpdates) ImageView.ScaleType.CENTER_CROP else ImageView.ScaleType.FIT_CENTER + } + listOf(binding.coverThumbnail, binding.card).forEach { + it.updateLayoutParams { + width = if (isUpdates) { + ViewGroup.LayoutParams.MATCH_PARENT + } else { + ViewGroup.LayoutParams.WRAP_CONTENT + } + } } binding.removeHistory.isVisible = item.mch.history.id != null && showRemoveHistory binding.title.apply {