Fixed ext bottom sheet not being able to drag in some casesq

case being:
1. open sheet
2. scroll down
3. press back (collapses sheet)
4. push new screen
5. go back
This commit is contained in:
Jays2Kings 2021-04-09 12:08:24 -04:00
parent 203758dddd
commit 3e7ad9dbd3

View File

@ -7,6 +7,7 @@ import androidx.recyclerview.widget.RecyclerView
import eu.davidea.flexibleadapter.FlexibleAdapter
import eu.davidea.flexibleadapter.items.IFlexible
import eu.kanade.tachiyomi.databinding.RecyclerWithScrollerBinding
import eu.kanade.tachiyomi.util.view.isExpanded
import eu.kanade.tachiyomi.util.view.updatePaddingRelative
class RecyclerWithScrollerView @JvmOverloads constructor(context: Context, attrs: AttributeSet? = null) :
@ -28,7 +29,10 @@ class RecyclerWithScrollerView @JvmOverloads constructor(context: Context, attrs
override fun onScrolled(recyclerView: RecyclerView, dx: Int, dy: Int) {
super.onScrolled(recyclerView, dx, dy)
if (sheet.isOnView(this@RecyclerWithScrollerView) && recyclerView.canScrollVertically(-1)) {
if (sheet.isOnView(this@RecyclerWithScrollerView) &&
sheet.sheetBehavior.isExpanded() &&
recyclerView.canScrollVertically(-1)
) {
sheet.sheetBehavior?.isDraggable = false
}
}