Remove the dividers between the new view
This commit is contained in:
parent
302db11482
commit
4a19f8cff2
@ -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
|
||||
|
||||
|
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user