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 1b2565ebd3..11adf82db4 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 @@ -40,7 +40,7 @@ class SourceComfortableGridHolder(private val view: View, private val adapter: F } override fun setImage(manga: Manga) { - // Setting this via XML doesn't work + // For rounded corners card.clipToOutline = true GlideApp.with(view.context).clear(thumbnail) 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/SourceGridHolder.kt index 9c8794dcdb..ecff1e23d8 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/SourceGridHolder.kt @@ -40,7 +40,7 @@ open class SourceGridHolder(private val view: View, private val adapter: Flexibl } override fun setImage(manga: Manga) { - // Setting this via XML doesn't work + // For rounded corners card.clipToOutline = true GlideApp.with(view.context).clear(thumbnail) 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 c058ae9a80..d318553ea4 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 @@ -9,6 +9,7 @@ import eu.kanade.tachiyomi.data.glide.GlideApp import eu.kanade.tachiyomi.data.glide.toMangaThumbnail import eu.kanade.tachiyomi.util.isLocal import eu.kanade.tachiyomi.util.view.visibleIf +import kotlinx.android.synthetic.main.source_comfortable_grid_item.badges import kotlinx.android.synthetic.main.source_comfortable_grid_item.card import kotlinx.android.synthetic.main.source_comfortable_grid_item.download_text import kotlinx.android.synthetic.main.source_comfortable_grid_item.local_text @@ -28,7 +29,7 @@ import kotlinx.android.synthetic.main.source_comfortable_grid_item.unread_text class LibraryComfortableGridHolder( private val view: View, adapter: FlexibleAdapter> -) : LibraryGridHolder(view, adapter) { +) : LibraryCompactGridHolder(view, adapter) { /** * Method called from [LibraryCategoryAdapter.onBindViewHolder]. It updates the data for this @@ -40,6 +41,9 @@ class LibraryComfortableGridHolder( // Update the title of the manga. title.text = item.manga.title + // For rounded corners + badges.clipToOutline = true + // Update the unread count and its visibility. with(unread_text) { visibleIf { item.unreadCount > 0 } @@ -53,7 +57,7 @@ class LibraryComfortableGridHolder( // set local visibility if its local manga local_text.visibleIf { item.manga.isLocal() } - // Setting this via XML doesn't work + // For rounded corners card.clipToOutline = true // Update the cover. diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/library/LibraryGridHolder.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/library/LibraryCompactGridHolder.kt similarity index 92% rename from app/src/main/java/eu/kanade/tachiyomi/ui/library/LibraryGridHolder.kt rename to app/src/main/java/eu/kanade/tachiyomi/ui/library/LibraryCompactGridHolder.kt index 4a01c7d539..215d91157d 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/library/LibraryGridHolder.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/library/LibraryCompactGridHolder.kt @@ -7,6 +7,7 @@ import eu.kanade.tachiyomi.data.glide.GlideApp import eu.kanade.tachiyomi.data.glide.toMangaThumbnail import eu.kanade.tachiyomi.util.isLocal import eu.kanade.tachiyomi.util.view.visibleIf +import kotlinx.android.synthetic.main.source_compact_grid_item.badges import kotlinx.android.synthetic.main.source_compact_grid_item.card import kotlinx.android.synthetic.main.source_compact_grid_item.download_text import kotlinx.android.synthetic.main.source_compact_grid_item.local_text @@ -23,7 +24,7 @@ import kotlinx.android.synthetic.main.source_compact_grid_item.unread_text * @param listener a listener to react to single tap and long tap events. * @constructor creates a new library holder. */ -open class LibraryGridHolder( +open class LibraryCompactGridHolder( private val view: View, private val adapter: FlexibleAdapter<*> ) : LibraryHolder(view, adapter) { @@ -38,6 +39,9 @@ open class LibraryGridHolder( // Update the title of the manga. title.text = item.manga.title + // For rounded corners + badges.clipToOutline = true + // Update the unread count and its visibility. with(unread_text) { visibleIf { item.unreadCount > 0 } @@ -51,7 +55,7 @@ open class LibraryGridHolder( // set local visibility if its local manga local_text.visibleIf { item.manga.isLocal() } - // Setting this via XML doesn't work + // For rounded corners card.clipToOutline = true // Update the cover. diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/library/LibraryItem.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/library/LibraryItem.kt index 5c5450fb1d..a246c2d6b2 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/library/LibraryItem.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/library/LibraryItem.kt @@ -48,7 +48,7 @@ class LibraryItem(val manga: LibraryManga, private val libraryDisplayMode: Prefe MATCH_PARENT, coverHeight / 2, Gravity.BOTTOM ) } - LibraryGridHolder(view, adapter) + LibraryCompactGridHolder(view, adapter) } DisplayMode.COMFORTABLE_GRID -> { val parent = adapter.recyclerView as AutofitRecyclerView diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/library/LibraryListHolder.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/library/LibraryListHolder.kt index e8cd29c5bf..bb9d563210 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/library/LibraryListHolder.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/library/LibraryListHolder.kt @@ -11,6 +11,7 @@ import eu.kanade.tachiyomi.data.glide.GlideApp import eu.kanade.tachiyomi.data.glide.toMangaThumbnail import eu.kanade.tachiyomi.util.isLocal import eu.kanade.tachiyomi.util.view.visibleIf +import kotlinx.android.synthetic.main.source_list_item.badges import kotlinx.android.synthetic.main.source_list_item.download_text import kotlinx.android.synthetic.main.source_list_item.local_text import kotlinx.android.synthetic.main.source_list_item.thumbnail @@ -42,6 +43,9 @@ class LibraryListHolder( // Update the title of the manga. title.text = item.manga.title + // For rounded corners + badges.clipToOutline = true + // Update the unread count and its visibility. with(unread_text) { visibleIf { item.unreadCount > 0 } diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/manga/info/MangaInfoController.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/manga/info/MangaInfoController.kt index 620df130f0..c909c379ad 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/manga/info/MangaInfoController.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/manga/info/MangaInfoController.kt @@ -91,7 +91,7 @@ class MangaInfoController(private val fromSource: Boolean = false) : override fun onViewCreated(view: View) { super.onViewCreated(view) - // Setting this via XML doesn't work + // For rounded corners binding.mangaCover.clipToOutline = true binding.btnFavorite.clicks() 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 ef8c6a2045..9547046f74 100644 --- a/app/src/main/res/layout/source_comfortable_grid_item.xml +++ b/app/src/main/res/layout/source_comfortable_grid_item.xml @@ -28,57 +28,19 @@ tools:ignore="ContentDescription" tools:src="@mipmap/ic_launcher" /> - - - - - + android:layout_marginStart="4dp" + android:layout_marginTop="4dp" + android:background="@drawable/rounded_rectangle"> - + + + + + - - - - - + android:layout_marginStart="4dp" + android:layout_marginTop="4dp" + android:background="@drawable/rounded_rectangle"> - + + + + + - - - + app:layout_constraintTop_toTopOf="parent"> - + + + + + + +