mirror of
https://github.com/tachiyomiorg/tachiyomi.git
synced 2024-11-20 04:49:15 +01:00
Reader chapter sheet now needs two swipes from recycler view to collapse
similar to other bottom sheets, if you're not at the top of the list and reach the top while dragging, it will not drag the sheet down. only when at the top it will drag down
This commit is contained in:
parent
c9fbe8f847
commit
18d385d5ac
@ -174,6 +174,19 @@ class ReaderChapterSheet @JvmOverloads constructor(context: Context, attrs: Attr
|
|||||||
else fullPrimary
|
else fullPrimary
|
||||||
)
|
)
|
||||||
|
|
||||||
|
binding.chapterRecycler.addOnScrollListener(object : RecyclerView.OnScrollListener() {
|
||||||
|
override fun onScrollStateChanged(recyclerView: RecyclerView, newState: Int) {
|
||||||
|
super.onScrollStateChanged(recyclerView, newState)
|
||||||
|
if (newState == RecyclerView.SCROLL_STATE_IDLE ||
|
||||||
|
newState == RecyclerView.SCROLL_STATE_SETTLING
|
||||||
|
) {
|
||||||
|
sheetBehavior?.isDraggable = true
|
||||||
|
} else {
|
||||||
|
sheetBehavior?.isDraggable = !recyclerView.canScrollVertically(-1)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
binding.chapterRecycler.layoutManager = LinearLayoutManager(context)
|
binding.chapterRecycler.layoutManager = LinearLayoutManager(context)
|
||||||
refreshList()
|
refreshList()
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user