mirror of
https://github.com/tachiyomiorg/tachiyomi.git
synced 2024-11-09 05:25:08 +01:00
Allow extensions/migration sheet to be dragged down while recycler is settling
This commit is contained in:
parent
881da13dc9
commit
c5f592bbe7
@ -22,7 +22,12 @@ class RecyclerWithScrollerView @JvmOverloads constructor(context: Context, attrs
|
|||||||
binding.recycler.addOnScrollListener(object : RecyclerView.OnScrollListener() {
|
binding.recycler.addOnScrollListener(object : RecyclerView.OnScrollListener() {
|
||||||
override fun onScrollStateChanged(recyclerView: RecyclerView, newState: Int) {
|
override fun onScrollStateChanged(recyclerView: RecyclerView, newState: Int) {
|
||||||
super.onScrollStateChanged(recyclerView, newState)
|
super.onScrollStateChanged(recyclerView, newState)
|
||||||
if (sheet.isOnView(this@RecyclerWithScrollerView) && newState == RecyclerView.SCROLL_STATE_IDLE) {
|
if (sheet.isOnView(this@RecyclerWithScrollerView) &&
|
||||||
|
(
|
||||||
|
newState == RecyclerView.SCROLL_STATE_IDLE ||
|
||||||
|
newState == RecyclerView.SCROLL_STATE_SETTLING
|
||||||
|
)
|
||||||
|
) {
|
||||||
sheet.sheetBehavior?.isDraggable = true
|
sheet.sheetBehavior?.isDraggable = true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -31,7 +36,8 @@ class RecyclerWithScrollerView @JvmOverloads constructor(context: Context, attrs
|
|||||||
super.onScrolled(recyclerView, dx, dy)
|
super.onScrolled(recyclerView, dx, dy)
|
||||||
if (sheet.isOnView(this@RecyclerWithScrollerView) &&
|
if (sheet.isOnView(this@RecyclerWithScrollerView) &&
|
||||||
sheet.sheetBehavior.isExpanded() &&
|
sheet.sheetBehavior.isExpanded() &&
|
||||||
recyclerView.canScrollVertically(-1)
|
recyclerView.canScrollVertically(-1) &&
|
||||||
|
recyclerView.scrollState != RecyclerView.SCROLL_STATE_SETTLING
|
||||||
) {
|
) {
|
||||||
sheet.sheetBehavior?.isDraggable = false
|
sheet.sheetBehavior?.isDraggable = false
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user