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
No known key found for this signature in database
GPG key ID: 37DBE3621FE9AD47

View file

@ -222,19 +222,17 @@ class HomeFragment :
collect(detailModel.toShow.flow, ::handleShow) collect(detailModel.toShow.flow, ::handleShow)
} }
override fun onStart() { override fun onResume() {
super.onStart() super.onResume()
// Stock bottom sheet overlay won't work with our nested UI setup, have to replicate // Stock bottom sheet overlay won't work with our nested UI setup, have to replicate
// it ourselves. // it ourselves.
requireBinding().root.rootView.apply { requireBinding().root.rootView.apply {
post { findViewById<View>(R.id.main_scrim).setOnTouchListener { _, event ->
findViewById<View>(R.id.main_scrim).setOnTouchListener { _, event -> handleSpeedDialBoundaryTouch(event)
handleSpeedDialBoundaryTouch(event) }
} findViewById<View>(R.id.sheet_scrim).setOnTouchListener { _, event ->
findViewById<View>(R.id.sheet_scrim).setOnTouchListener { _, event -> handleSpeedDialBoundaryTouch(event)
handleSpeedDialBoundaryTouch(event)
}
} }
} }
} }