diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/browse/source/browse/SourceComfortableGridHolder.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/browse/source/browse/SourceComfortableGridHolder.kt index b3dd990714..e7b5ee56ea 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/browse/source/browse/SourceComfortableGridHolder.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/browse/source/browse/SourceComfortableGridHolder.kt @@ -39,11 +39,11 @@ class SourceComfortableGridHolder(private val view: View, private val adapter: F binding.thumbnail.alpha = if (manga.favorite) 0.3f else 1.0f // For rounded corners - binding.leftBadges.clipToOutline = true - binding.rightBadges.clipToOutline = true + binding.badges.leftBadges.clipToOutline = true + binding.badges.rightBadges.clipToOutline = true // Set favorite badge - binding.favoriteText.isVisible = manga.favorite + binding.badges.favoriteText.isVisible = manga.favorite setImage(manga) } diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/browse/source/browse/SourceGridHolder.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/browse/source/browse/SourceCompactGridHolder.kt similarity index 81% rename from app/src/main/java/eu/kanade/tachiyomi/ui/browse/source/browse/SourceGridHolder.kt rename to app/src/main/java/eu/kanade/tachiyomi/ui/browse/source/browse/SourceCompactGridHolder.kt index f0cc033854..53af51d7c9 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/browse/source/browse/SourceGridHolder.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/browse/source/browse/SourceCompactGridHolder.kt @@ -9,7 +9,7 @@ import coil.transition.CrossfadeTransition import eu.davidea.flexibleadapter.FlexibleAdapter import eu.kanade.tachiyomi.data.coil.MangaCoverFetcher import eu.kanade.tachiyomi.data.database.models.Manga -import eu.kanade.tachiyomi.databinding.SourceComfortableGridItemBinding +import eu.kanade.tachiyomi.databinding.SourceCompactGridItemBinding import eu.kanade.tachiyomi.widget.StateImageViewTarget /** @@ -20,10 +20,10 @@ import eu.kanade.tachiyomi.widget.StateImageViewTarget * @param adapter the adapter handling this holder. * @constructor creates a new catalogue holder. */ -open class SourceGridHolder(private val view: View, private val adapter: FlexibleAdapter<*>) : - SourceHolder(view, adapter) { +open class SourceCompactGridHolder(private val view: View, private val adapter: FlexibleAdapter<*>) : + SourceHolder(view, adapter) { - override val binding = SourceComfortableGridItemBinding.bind(view) + override val binding = SourceCompactGridItemBinding.bind(view) /** * Method called from [CatalogueAdapter.onBindViewHolder]. It updates the data for this @@ -39,11 +39,11 @@ open class SourceGridHolder(private val view: View, private val adapter: Flexibl binding.thumbnail.alpha = if (manga.favorite) 0.3f else 1.0f // For rounded corners - binding.leftBadges.clipToOutline = true - binding.rightBadges.clipToOutline = true + binding.badges.leftBadges.clipToOutline = true + binding.badges.rightBadges.clipToOutline = true // Set favorite badge - binding.favoriteText.isVisible = manga.favorite + binding.badges.favoriteText.isVisible = manga.favorite setImage(manga) } diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/browse/source/browse/SourceItem.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/browse/source/browse/SourceItem.kt index b905246c2c..49188ed707 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/browse/source/browse/SourceItem.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/browse/source/browse/SourceItem.kt @@ -48,7 +48,7 @@ class SourceItem(val manga: Manga, private val displayMode: Preference { val binding = SourceComfortableGridItemBinding.bind(view) diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/library/LibraryComfortableGridHolder.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/library/LibraryComfortableGridHolder.kt index 518e2ae29a..6cc9a39bfb 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/library/LibraryComfortableGridHolder.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/library/LibraryComfortableGridHolder.kt @@ -36,26 +36,26 @@ class LibraryComfortableGridHolder( binding.title.text = item.manga.title // For rounded corners - binding.leftBadges.clipToOutline = true - binding.rightBadges.clipToOutline = true + binding.badges.leftBadges.clipToOutline = true + binding.badges.rightBadges.clipToOutline = true // Update the unread count and its visibility. - with(binding.unreadText) { + with(binding.badges.unreadText) { isVisible = item.unreadCount > 0 text = item.unreadCount.toString() } // Update the download count and its visibility. - with(binding.downloadText) { + with(binding.badges.downloadText) { isVisible = item.downloadCount > 0 text = item.downloadCount.toString() } // Update the source language and its visibility - with(binding.languageText) { + with(binding.badges.languageText) { isVisible = item.sourceLanguage.isNotEmpty() text = item.sourceLanguage } // set local visibility if its local manga - binding.localText.isVisible = item.isLocal + binding.badges.localText.isVisible = item.isLocal // For rounded corners binding.card.clipToOutline = true diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/library/LibraryCompactGridHolder.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/library/LibraryCompactGridHolder.kt index 45c8349f81..e5459fbdc6 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/library/LibraryCompactGridHolder.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/library/LibraryCompactGridHolder.kt @@ -34,26 +34,26 @@ open class LibraryCompactGridHolder( binding.title.text = item.manga.title // For rounded corners - binding.leftBadges.clipToOutline = true - binding.rightBadges.clipToOutline = true + binding.badges.leftBadges.clipToOutline = true + binding.badges.rightBadges.clipToOutline = true // Update the unread count and its visibility. - with(binding.unreadText) { + with(binding.badges.unreadText) { isVisible = item.unreadCount > 0 text = item.unreadCount.toString() } // Update the download count and its visibility. - with(binding.downloadText) { + with(binding.badges.downloadText) { isVisible = item.downloadCount > 0 text = item.downloadCount.toString() } // Update the source language and its visibility - with(binding.languageText) { + with(binding.badges.languageText) { isVisible = item.sourceLanguage.isNotEmpty() text = item.sourceLanguage } // set local visibility if its local manga - binding.localText.isVisible = item.isLocal + binding.badges.localText.isVisible = item.isLocal // For rounded corners binding.card.clipToOutline = true diff --git a/app/src/main/res/layout/source_comfortable_grid_item.xml b/app/src/main/res/layout/source_comfortable_grid_item.xml index 91f570f5b3..0fc5d10201 100644 --- a/app/src/main/res/layout/source_comfortable_grid_item.xml +++ b/app/src/main/res/layout/source_comfortable_grid_item.xml @@ -31,114 +31,9 @@ tools:ignore="ContentDescription" tools:src="@mipmap/ic_launcher" /> - - - - - - - - - - - - - - - - - - - - - + layout="@layout/source_grid_item_badges" /> - - - - - - - - - - - - - - - - - - - - + layout="@layout/source_grid_item_badges" /> + + + + + + + + + + + + + + + + + + + + + + +