Remove the dividers between the new view

This commit is contained in:
Jobobby04 2020-07-25 21:20:07 -04:00
parent 302db11482
commit 4a19f8cff2
2 changed files with 3 additions and 3 deletions

View File

@ -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

View File

@ -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