home: make sure to avoid touch overlay crash

Only configure the touch overlay when the fragment resumes, and don't
do any weird post stuff.
This commit is contained in:
Alexander Capehart
2024-02-24 13:27:52 -07:00
parent a036005f75
commit 5efdfb6aac
@@ -222,19 +222,17 @@ class HomeFragment :
collect(detailModel.toShow.flow, ::handleShow)
}
override fun onStart() {
super.onStart()
override fun onResume() {
super.onResume()
// Stock bottom sheet overlay won't work with our nested UI setup, have to replicate
// it ourselves.
requireBinding().root.rootView.apply {
post {
findViewById<View>(R.id.main_scrim).setOnTouchListener { _, event ->
handleSpeedDialBoundaryTouch(event)
}
findViewById<View>(R.id.sheet_scrim).setOnTouchListener { _, event ->
handleSpeedDialBoundaryTouch(event)
}
findViewById<View>(R.id.main_scrim).setOnTouchListener { _, event ->
handleSpeedDialBoundaryTouch(event)
}
findViewById<View>(R.id.sheet_scrim).setOnTouchListener { _, event ->
handleSpeedDialBoundaryTouch(event)
}
}
}