mirror of
https://github.com/null2264/yokai.git
synced 2025-06-21 10:44:42 +00:00
parent
b0233b91b9
commit
5fb0fe40de
3 changed files with 5 additions and 1 deletions
|
@ -13,6 +13,7 @@ import eu.kanade.tachiyomi.data.image.coil.loadManga
|
||||||
import eu.kanade.tachiyomi.databinding.MangaGridItemBinding
|
import eu.kanade.tachiyomi.databinding.MangaGridItemBinding
|
||||||
import eu.kanade.tachiyomi.util.lang.highlightText
|
import eu.kanade.tachiyomi.util.lang.highlightText
|
||||||
import eu.kanade.tachiyomi.util.system.dpToPx
|
import eu.kanade.tachiyomi.util.system.dpToPx
|
||||||
|
import eu.kanade.tachiyomi.util.view.setCards
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Class used to hold the displayed data of a manga in the library, like the cover or the title.
|
* Class used to hold the displayed data of a manga in the library, like the cover or the title.
|
||||||
|
@ -56,6 +57,7 @@ class LibraryGridHolder(
|
||||||
*/
|
*/
|
||||||
override fun onSetValues(item: LibraryItem) {
|
override fun onSetValues(item: LibraryItem) {
|
||||||
// Update the title and subtitle of the manga.
|
// Update the title and subtitle of the manga.
|
||||||
|
setCards(adapter.showOutline, binding.card, binding.unreadDownloadBadge.root)
|
||||||
binding.constraintLayout.isVisible = !item.manga.isBlank()
|
binding.constraintLayout.isVisible = !item.manga.isBlank()
|
||||||
binding.title.text = item.manga.title.highlightText(item.filter, color)
|
binding.title.text = item.manga.title.highlightText(item.filter, color)
|
||||||
val authorArtist = if (item.manga.author == item.manga.artist || item.manga.artist.isNullOrBlank()) {
|
val authorArtist = if (item.manga.author == item.manga.artist || item.manga.artist.isNullOrBlank()) {
|
||||||
|
|
|
@ -26,7 +26,7 @@ abstract class LibraryHolder(
|
||||||
|
|
||||||
init {
|
init {
|
||||||
val card = itemView.findViewById<MaterialCardView>(R.id.card)
|
val card = itemView.findViewById<MaterialCardView>(R.id.card)
|
||||||
val badgeView = itemView.findViewById<LibraryBadge>(R.id.badge_view)
|
val badgeView = itemView.findViewById<LibraryBadge>(R.id.unread_download_badge)
|
||||||
if (card != null && badgeView != null) {
|
if (card != null && badgeView != null) {
|
||||||
setCards(adapter.showOutline, card, badgeView)
|
setCards(adapter.showOutline, card, badgeView)
|
||||||
}
|
}
|
||||||
|
|
|
@ -10,6 +10,7 @@ import eu.kanade.tachiyomi.data.image.coil.loadManga
|
||||||
import eu.kanade.tachiyomi.databinding.MangaListItemBinding
|
import eu.kanade.tachiyomi.databinding.MangaListItemBinding
|
||||||
import eu.kanade.tachiyomi.util.lang.highlightText
|
import eu.kanade.tachiyomi.util.lang.highlightText
|
||||||
import eu.kanade.tachiyomi.util.system.dpToPx
|
import eu.kanade.tachiyomi.util.system.dpToPx
|
||||||
|
import eu.kanade.tachiyomi.util.view.setCards
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Class used to hold the displayed data of a manga in the library, like the cover or the binding.title.
|
* Class used to hold the displayed data of a manga in the library, like the cover or the binding.title.
|
||||||
|
@ -34,6 +35,7 @@ class LibraryListHolder(
|
||||||
* @param item the manga item to bind.
|
* @param item the manga item to bind.
|
||||||
*/
|
*/
|
||||||
override fun onSetValues(item: LibraryItem) {
|
override fun onSetValues(item: LibraryItem) {
|
||||||
|
setCards(adapter.showOutline, binding.card, binding.unreadDownloadBadge.root)
|
||||||
binding.title.isVisible = true
|
binding.title.isVisible = true
|
||||||
binding.constraintLayout.minHeight = 56.dpToPx
|
binding.constraintLayout.minHeight = 56.dpToPx
|
||||||
if (item.manga.isBlank()) {
|
if (item.manga.isBlank()) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue