From 0a10f6605324684afcf4d6bc13a765709dec2d94 Mon Sep 17 00:00:00 2001 From: Andreas Date: Thu, 28 Jan 2021 00:28:02 +0100 Subject: [PATCH] Unify history and update item (#4361) * Unify history and update item * Use card_radius --- .../ui/recent/history/HistoryHolder.kt | 8 +- app/src/main/res/layout/history_item.xml | 139 +++++++++--------- app/src/main/res/layout/updates_item.xml | 12 +- 3 files changed, 81 insertions(+), 78 deletions(-) diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/recent/history/HistoryHolder.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/recent/history/HistoryHolder.kt index d96ab429d7..3d10d931d0 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/recent/history/HistoryHolder.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/recent/history/HistoryHolder.kt @@ -2,6 +2,9 @@ package eu.kanade.tachiyomi.ui.recent.history 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.davidea.viewholders.FlexibleViewHolder import eu.kanade.tachiyomi.R import eu.kanade.tachiyomi.data.database.models.MangaChapterHistory @@ -65,12 +68,15 @@ class HistoryHolder( binding.mangaSubtitle.text = Date(history.last_read).toTimestampString() } + val radius = itemView.context.resources.getDimensionPixelSize(R.dimen.card_radius) + val requestOptions = RequestOptions().transform(CenterCrop(), RoundedCorners(radius)) + // Set cover GlideApp.with(itemView.context).clear(binding.cover) GlideApp.with(itemView.context) .load(manga.toMangaThumbnail()) .diskCacheStrategy(DiskCacheStrategy.RESOURCE) - .centerCrop() + .apply(requestOptions) .into(binding.cover) } } diff --git a/app/src/main/res/layout/history_item.xml b/app/src/main/res/layout/history_item.xml index ab8e550d89..155d21eef0 100644 --- a/app/src/main/res/layout/history_item.xml +++ b/app/src/main/res/layout/history_item.xml @@ -1,84 +1,81 @@ - + android:layout_width="match_parent" + android:layout_height="80dp" + android:layout_marginStart="16dp" + android:layout_marginTop="8dp" + android:layout_marginEnd="8dp" + android:layout_marginBottom="8dp" + android:orientation="horizontal"> - + - + - + android:ellipsize="end" + android:maxLines="2" + android:textAppearance="@style/TextAppearance.Medium" + tools:text="Title" /> - - - - - - - + android:layout_marginTop="4dp" + tools:text="Subtitle" /> - + - + - + + + diff --git a/app/src/main/res/layout/updates_item.xml b/app/src/main/res/layout/updates_item.xml index 3dc1b77cf2..600597b30d 100644 --- a/app/src/main/res/layout/updates_item.xml +++ b/app/src/main/res/layout/updates_item.xml @@ -9,13 +9,13 @@ @@ -27,7 +27,7 @@ android:layout_marginStart="16dp" android:ellipsize="end" android:maxLines="1" - android:textAppearance="@style/TextAppearance.Regular.Body1" + android:textAppearance="@style/TextAppearance.Medium.Body2" app:layout_constraintBottom_toTopOf="@+id/chapter_title" app:layout_constraintEnd_toStartOf="@+id/download" app:layout_constraintStart_toEndOf="@+id/manga_cover"