mirror of
https://github.com/tachiyomiorg/tachiyomi.git
synced 2024-12-23 06:11:50 +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
|
||||
)
|
||||
|
||||
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)
|
||||
refreshList()
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user