From 4a19f8cff208aa334a66c50a6016af26dfa4e912 Mon Sep 17 00:00:00 2001 From: Jobobby04 Date: Sat, 25 Jul 2020 21:20:07 -0400 Subject: [PATCH] Remove the dividers between the new view --- .../main/java/eu/kanade/tachiyomi/ui/manga/MangaController.kt | 2 +- .../ui/manga/chapter/ChapterDividerItemDecoration.kt | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/manga/MangaController.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/manga/MangaController.kt index 12fd625a7..ac48cf7e0 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/manga/MangaController.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/manga/MangaController.kt @@ -235,7 +235,7 @@ class MangaController : binding.recycler.adapter = ConcatAdapter(adapters) binding.recycler.layoutManager = LinearLayoutManager(view.context) - binding.recycler.addItemDecoration(ChapterDividerItemDecoration(view.context)) + binding.recycler.addItemDecoration(ChapterDividerItemDecoration(view.context, if (preferences.recommendsInOverflow().get()) 3 else 4)) binding.recycler.setHasFixedSize(true) chaptersAdapter?.fastScroller = binding.fastScroller diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/manga/chapter/ChapterDividerItemDecoration.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/manga/chapter/ChapterDividerItemDecoration.kt index e59a835c2..c5f013e4a 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/manga/chapter/ChapterDividerItemDecoration.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/manga/chapter/ChapterDividerItemDecoration.kt @@ -13,7 +13,7 @@ import androidx.recyclerview.widget.RecyclerView * Used in MangaController since the manga info header and chapters header are the first two * items in the list using a ConcatAdapter. */ -class ChapterDividerItemDecoration(context: Context) : RecyclerView.ItemDecoration() { +class ChapterDividerItemDecoration(context: Context, val skipAdapers: Int) : RecyclerView.ItemDecoration() { private val divider: Drawable @@ -30,7 +30,7 @@ class ChapterDividerItemDecoration(context: Context) : RecyclerView.ItemDecorati canvas.save() val childCount = parent.childCount - for (i in 1 until childCount) { + for (i in skipAdapers until childCount) { val child = parent.getChildAt(i) val params = child.layoutParams as RecyclerView.LayoutParams val top = child.bottom + params.bottomMargin