Fix source filter sheet not resizing when content inside changes

This commit is contained in:
Jays2Kings 2021-07-19 19:22:22 -04:00
parent a3d0beb40c
commit cbf7e116d7

View File

@ -85,6 +85,10 @@ class SourceFilterSheet(val activity: Activity) :
} }
}) })
binding.filtersRecycler.viewTreeObserver.addOnScrollChangedListener {
updateBottomButtons()
}
setOnShowListener { setOnShowListener {
updateBottomButtons() updateBottomButtons()
} }
@ -92,7 +96,7 @@ class SourceFilterSheet(val activity: Activity) :
binding.filtersRecycler.layoutManager = androidx.recyclerview.widget.LinearLayoutManager(context) binding.filtersRecycler.layoutManager = androidx.recyclerview.widget.LinearLayoutManager(context)
binding.filtersRecycler.clipToPadding = false binding.filtersRecycler.clipToPadding = false
binding.filtersRecycler.adapter = adapter binding.filtersRecycler.adapter = adapter
binding.filtersRecycler.setHasFixedSize(true) binding.filtersRecycler.setHasFixedSize(false)
sheetBehavior.addBottomSheetCallback( sheetBehavior.addBottomSheetCallback(
object : BottomSheetBehavior.BottomSheetCallback() { object : BottomSheetBehavior.BottomSheetCallback() {